>

+ 92 - 10
oa-app/src/main/java/com/css/oa/exam/admin/controller/CasLoginController.java

@ -1,10 +1,13 @@
1 1
package com.css.oa.exam.admin.controller;
2 2
3
import cn.com.dhcc.uums.entity.SSORole;
3 4
import cn.com.dhcc.uums.entity.SSOUser;
4 5
import cn.com.dhcc.uums.util.SSOTools;
5 6
import com.css.bpm.platform.org.dept.repository.entity.DeptEntity;
7
import com.css.bpm.platform.org.user.repository.entity.UserEntity;
6 8
import com.css.oa.utils.*;
7 9
import com.fasterxml.jackson.databind.ObjectMapper;
10
import com.google.gson.Gson;
8 11
import io.swagger.annotations.Api;
9 12
import io.swagger.annotations.ApiOperation;
10 13
import org.apache.commons.lang3.StringUtils;
@ -13,6 +16,7 @@ import org.slf4j.LoggerFactory;
13 16
import org.springframework.beans.BeanUtils;
14 17
import org.springframework.beans.factory.annotation.Autowired;
15 18
import org.springframework.data.domain.Page;
19
import org.springframework.data.redis.core.RedisTemplate;
16 20
import org.springframework.web.bind.annotation.GetMapping;
17 21
import org.springframework.web.bind.annotation.RequestMapping;
18 22
import org.springframework.web.bind.annotation.RequestParam;
@ -30,7 +34,7 @@ import java.util.List;
30 34
@RestController
31 35
@RequestMapping("/casLogin")
32 36
public class CasLoginController {
33
//
37
    //
34 38
//    @Autowired
35 39
//    DepartmentService departmentService;
36 40
//    @Autowired
@ -40,39 +44,117 @@ public class CasLoginController {
40 44
41 45
    Logger log = LoggerFactory.getLogger(CasLoginController.class);
42 46
47
    @Autowired
48
    RedisTemplate redisTemplate;
49
50
    @Autowired
51
    UserAPIService userAPIService;
43 52
44 53
    @ApiOperation(value = "登录")
45 54
    @RequestMapping("/login")
46 55
    public void login(HttpSession session, HttpServletResponse response, HttpServletRequest request) {
47 56
        try {
48
57
            /*{
58
                "id": "fc80fa44f4ab4c389cddb17837074a34",
59
                    "persCode": "140622198906200032",
60
                    "userName": "zangtie",
61
                    "persName": "臧铁",
62
                    "orgCode": "100000002",
63
                    "orgName": "其他",
64
                    "orgJurd": "",
65
                    "jurdAreaType": "",
66
                    "adminOrgCode": "",
67
                    "depCode": "8be30b2208ff4b899be59c51465d34fe",
68
                    "depName": "临时部门",
69
                    "userState": "1",
70
                    "caCertification": "",
71
                    "ordernum": "95656",
72
                    "creater": "",
73
                    "modifier": "",
74
                    "roleInfoList": [
75
                {
76
                    "id": "9b0e3d32582d48a5be2af92a89cadc56",
77
                        "roleCode": "kfz",
78
                        "roleName": "开发者",
79
                        "roleDesc": "",
80
                        "roleType": "1",
81
                        "orgId": "",
82
                        "orgCode": "",
83
                        "orgName": "",
84
                        "orgJurd": "",
85
                        "jurdAreaType": "",
86
                        "sysId": "",
87
                        "sysCode": "2222",
88
                        "status": "1",
89
                        "creater": "",
90
                        "modifier": "",
91
                        "ordernum": "",
92
                        "note": ""
93
                },
94
                {
95
                    "id": "6b303bd8624e4c308401dfa1d3f2ac99",
96
                        "roleCode": "cdglxt",
97
                        "roleName": "菜单管理系统",
98
                        "roleDesc": "管理业务系统管理员的菜单",
99
                        "roleType": "1",
100
                        "orgId": "",
101
                        "orgCode": "",
102
                        "orgName": "",
103
                        "orgJurd": "",
104
                        "jurdAreaType": "",
105
                        "sysId": "",
106
                        "sysCode": "1001",
107
                        "status": "1",
108
                        "creater": "",
109
                        "modifier": "",
110
                        "ordernum": "",
111
                        "note": "管理业务系统管理员的菜单"
112
                }
113
  ]
114
            }
115
*/
49 116
            SSOUser ssoUser = SSOTools.getSSOUser(request);
117
            redisTemplate.opsForValue().set("131452021-SSOUSER", ssoUser);
118
            redisTemplate.opsForValue().set("131452021-ROLEINFOLIST", ssoUser.getRoleInfoList());
119
            SSOUser ssoUser1 = (SSOUser) redisTemplate.opsForValue().get("131452021-SSOUSER");
120
            List<SSORole> roleList = (List<SSORole>) redisTemplate.opsForValue().get("131452021-ROLEINFOLIST");
121
122
123
124
            UserEntity user = userAPIService.getUser(ssoUser1.getId());
125
            System.out.println(user);
126
            System.out.println(roleList);
127
128
            String json = new Gson().toJson(ssoUser);
129
            System.out.println(json);
50 130
            session.setAttribute("UUID", ssoUser.getId());
51 131
            session.setAttribute("USER_NAME", ssoUser.getUserName());
52 132
            session.setAttribute("ORG_NAME", ssoUser.getOrgName());
53 133
            session.setAttribute("DEP_NAME", ssoUser.getDepName());
54 134
            session.setAttribute("ROLE_INFO", ssoUser.getRoleInfoList().get(0));
55 135
            String contextPath = request.getContextPath();
56
            response.sendRedirect("http://localhost:8081/#/title_declaration/announcement_management");
57
        } catch (Exception e){
136
            response.sendRedirect("http://10.1.76.181:8081/zhbg/static/core/oa/TitleExamination/index.html");
137
        } catch (Exception e) {
58 138
            log.error("登录失败!", e);
59
        };
139
        }
140
        ;
60 141
    }
61 142
62 143
    @ApiOperation(value = "登出")
63 144
    @RequestMapping("/logout")
64
    public void logout(HttpSession session, HttpServletResponse response, HttpServletRequest request){
145
    public void logout(HttpSession session, HttpServletResponse response, HttpServletRequest request) {
65 146
//        HttpSession session = request.getSession();
66 147
        try {
148
            System.out.print("登出---->" + session.toString());
67 149
            session.invalidate();
68 150
            // http://10.1.193.115:8100/cas/logout?service=http://10.1.176.129:8081/zhbg
69
            response.sendRedirect("http://10.1.193.115:8100/cas/logout?service=http://10.1.176.129:8081/zhbg");
70
        } catch (Exception e){
151
            response.sendRedirect("http://idportal_test.mwr.cn:8100/cas/logout?service=http://10.1.76.181:8081/zhbg");
152
        } catch (Exception e) {
71 153
            log.error("登出失败!", e);
72
        };
154
        }
155
        ;
73 156
74 157
    }
75 158
76 159
77
78 160
}

+ 5 - 4
oa-app/src/main/resources/application.yml

@ -2,12 +2,13 @@ server:
2 2
  port: 8081
3 3
  servlet:
4 4
    context-path: /zhbg
5
5 6
spring:
6 7
  cas:
7
    #夏博电脑的IP地址
8
    server-name: http://10.1.176.129:8081/zhbg
9
    #支撑平台服务地址
10
    cas-server-url-prefix: http://10.1.193.115:8100/cas
8
    #    server-name: http://10.1.176.129:8081/zhbg
9
    server-name: http://10.1.76.181:8081/zhbg
10
    #    cas-server-url-prefix: http://10.1.193.115:8100/cas
11
    cas-server-url-prefix: http://idportal_test.mwr.cn:8100/cas
11 12
    cas-server-login-url: ${spring.cas.cas-server-url-prefix}/login
12 13
    cas-server-logout-url: ${spring.cas.cas-server-url-prefix}/logout
13 14
    ignore-pattern: (register|\.js|\.img|\.css)(\?.*)?$

XinChuang/admin_api - Gogs: Go Git Service

231 Commits (b1a430a908f7b4daee9bca2cca960a42c7d53e4e)

Author SHA1 Message Date
  zhuhaiwen b1a430a908 统计报表=>考点考场人员信息 3 years ago
  zhuhaiwen 2fbc4e803a 附件下载2 3 years ago
  zhuhaiwen 3dcf64d51d 公告附件下载 3 years ago
  zhuhaiwen 0af78c7d84 a 3 years ago
  zhuhaiwen f674f97209 统计报表1 3 years ago
  zhuhaiwen ae072d11a7 增加节点接口 3 years ago
  zhuhaiwen 1dff4478a5 节点控制 3 years ago
  zhuhaiwen 0b0ef16216 后台页修改 3 years ago
  zhuhaiwen 298a1485b3 后台页:预览合格证 3 years ago
  zhuhaiwen 82ee2f399e 后台页:预览准考证 3 years ago
  zhuhaiwen 49267f0fb1 文件下载2 3 years ago
  zhuhaiwen d8757ed20f 文件下载2 3 years ago
  zhuhaiwen f09d76a1fa 下载1 3 years ago
  zhuhaiwen a61a9bdb6b 文件上传 3 years ago
  zhuhaiwen a4556b507c 张伟昌签名 3 years ago
  zhuhaiwen 46be085d39 groupBy重写 3 years ago
  zhuhaiwen 42f69e8b42 export setProperties 3 years ago
  zhuhaiwen 46d20c1819 报名管理排序 3 years ago
  zhuhaiwen d91f3f8ca9 公告搜索 3 years ago
  zhuhaiwen 78f5b33aaf 手机端公告搜索 3 years ago
  zhuhaiwen 7dedc5997a 有效期2 3 years ago
  zhuhaiwen af2394ecd4 有效期 3 years ago
  zhuhaiwen 2bb6be1b27 数据表名 3 years ago
  zhuhaiwen 548f68c78b 设置是否及格 3 years ago
  zhuhaiwen 07e9217309 后台页面设置作弊状态 3 years ago
  zhuhaiwen c6659a33d7 a 3 years ago
  zhuhaiwen 97603797dd 准考证、合格证规则 3 years ago
  zhuhaiwen 3504f572d7 黑名单bug 3 years ago
  zhuhaiwen 8d62dbd46f 作弊管理 3 years ago
  zhuhaiwen 6b94b0cecd 撤销分配考场修改 3 years ago
  zhuhaiwen 9e5a52e745 华南水利局创建的考点,它的下级都能用 3 years ago
  zhuhaiwen 05594d2e1e 提交个人报名后显示自己的信息 3 years ago
  zhuhaiwen 71ee77515b a 3 years ago
  zhuhaiwen 9844a37d5d a 3 years ago
  zhuhaiwen aadf8d8b9f a 3 years ago
  zhuhaiwen 38df1538e1 提交报名时候判断考试是否存在 3 years ago
  zhuhaiwen d8825f9144 queryHisAll 3 years ago
  zhuhaiwen f5fca736be 层层审核修改 3 years ago
  zhuhaiwen 57af7b43ef a 3 years ago
  zhuhaiwen 0cb1d71f67 a 3 years ago
  zhuhaiwen 43b14432d3 修bug 3 years ago
  zhuhaiwen 24bc5903d3 考点、考场授权2 3 years ago
  zhuhaiwen 1bf5f03484 授权 3 years ago
  zhuhaiwen ab20c07daf 考点、考场组织单位的操作权限 3 years ago
  zhuhaiwen f2b10bff2b 系列、级别2 3 years ago
  zhuhaiwen c1caf8fe75 系列、级别 3 years ago
  zhuhaiwen aaeaa49dca a 3 years ago
  zhuhaiwen f6ba101b90 成绩分析导出 3 years ago
  zhuhaiwen 1aeefe5b3b 跨域 3 years ago
  zhuhaiwen bdfa5e6ddc 成绩分析导出 3 years ago
admin_api - Gogs: Go Git Service

后台管理系统Java代码

电子公文处理系统交流文档.docx 311KB