ent="modify" data-variation="inverted tiny" data-position="right center">  oa-app/src/main/resources/application.yml

+ 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)(\?.*)?$

支付接口 · 3c840533e1 - Gogs: Go Git Service
yy 3 年 前
コミット
3c840533e1
共有3 個のファイルを変更した72 個の追加39 個の削除を含む
  1. 66 12
      src/views/PersonalCenter/ExaminationPayment/PayDetails.vue
  2. 4 25
      src/views/PersonalCenter/ExaminationPayment/index.vue
  3. 2 2
      src/views/home/index.vue

+ 66 - 12
src/views/PersonalCenter/ExaminationPayment/PayDetails.vue

@ -26,38 +26,92 @@
26 26
      <el-form-item label="考点:">
27 27
        {{ form.want_place_name }}
28 28
      </el-form-item>
29
      <el-form-item label="缴费方式:" v-if="form.pay_state == '未缴费'">
30
        <el-select v-model="payValue" placeholder="请选择">
31
          <el-option label="微信" value="1">微信</el-option>
32
          <el-option label="支付宝" value="2">支付宝</el-option>
33
        </el-select>
34
      </el-form-item>
35
      <el-form-item label="缴费方式:" v-if="form.pay_state != '未缴费'">
36
        微信
37
      </el-form-item>
38 29
    </el-form>
39 30
    <p slot="footer" class="dialog-footer" style="text-align: center;margin: 0;">
40
      <el-button v-if="form.pay_state == '未缴费'" type="primary" style="border-radius: 3rem;width: 4rem;margin-bottom:.4rem;">缴费</el-button>
31
      <el-button @click="toPay" v-if="form.pay_state == '未缴费'" type="primary" style="border-radius: 3rem;width: 4rem;margin-bottom:.4rem;">缴费</el-button>
41 32
    </p>
42 33
  </div>
43 34
</template>
44 35
45 36
<script>
46 37
import local from "@/utils/local";
38
import {
39
  getMyPayIsClose, //列表
40
} from "@/api/home";
47 41
export default {
48 42
  data() {
49 43
    return {
50 44
      form: {},
51
      payValue: ""
45
      payValue: "",
46
      payState: "",
52 47
    }
53 48
  },
54 49
  created() {
55 50
    this.form = local.get("payDetails");
51
    this.myPayIsClose();
56 52
  },
57 53
  methods: {
54
    // 缴费节点状态
55
    async myPayIsClose() {
56
      let res = await getMyPayIsClose({});
57
58
      // 解构数据
59
      let { code, data, msg } = res;
60
61
      // 赋值渲染
62
      if (code === 200) {
63
        this.payState = msg;
64
      }
65
    },
58 66
    goback() {
59 67
      this.$router.go(-1)
60
    }
68
    },
69
    toPay() {
70
      if(this.payState == 'true'){
71
        this.$message("考试缴费还未开启,请稍后操作");
72
      }else{
73
        const serverBaseUrl = window.serverUrl.url;
74
        var xhr = new XMLHttpRequest();
75
        var url = serverBaseUrl+'/easypay/pay';
76
        xhr.open("post", url, true);
77
        xhr.setRequestHeader('content-type', 'application/json;charset=UTF-8')
78
        xhr.setRequestHeader('Authorization', 'Bearer 1');
79
        var data = {
80
            enroll_id:'0b716740f24544939d40685c02333ddb'
81
        };
82
        xhr.send(JSON.stringify(data));
83
84
        xhr.onreadystatechange = function () {
85
          if (xhr.readyState == XMLHttpRequest.DONE) {
86
            console.log('结果0:', xhr.responseText)
87
            try {
88
              if (xhr.responseText) {
89
                const response = JSON.parse(xhr.responseText);
90
                console.log('结果1:', response)
91
                if (xhr.status && xhr.status == 200) {
92
                  if (response.code == 500) {
93
                    //alert(response.msg);
94
                  } else if (response.code == 200) {
95
                    let url = response.data.redirectUrl;
96
                    window.open(url, '_blank').location;
97
                    let con;
98
                    con=confirm("是否已完成支付?"); //在页面上弹出对话框
99
                    if(con==true) window.location.reload();
100
                    else ;
101
                    // alert('信息显示为:是否已经完成支付? 已支付、未支付两个按钮!')
102
                    //TODO 点击"已支付",刷新当前页面。  点击"未支付",什么也不操作,弹框消失
103
                  }
104
                } else {
105
                    alert(response.msg);
106
                }
107
              }
108
            } catch (e) {
109
110
            }
111
          }
112
        };
113
      }
114
    },
61 115
  }
62 116
}
63 117
</script>

+ 4 - 25
src/views/PersonalCenter/ExaminationPayment/index.vue

@ -17,13 +17,11 @@
17 17
import local from "@/utils/local";
18 18
import {
19 19
  getPayList, //列表
20
  getMyPayIsClose,
21 20
} from "@/api/home";
22 21
export default {
23 22
  data() {
24 23
    return {
25 24
      tableData: [],
26
      payState: "",
27 25
    }
28 26
  },
29 27
  created() {
@ -42,32 +40,13 @@ export default {
42 40
      // 赋值渲染
43 41
      if (code === 200) {
44 42
        this.tableData = data.myEnroll;
45
        this.myPayIsClose();
46
      }
47
    },
48
    // 缴费节点状态
49
    async myPayIsClose() {
50
      let res = await getMyPayIsClose({});
51
52
      // 解构数据
53
      let { code, data, msg } = res;
54
55
      // 赋值渲染
56
      if (code === 200) {
57
        this.payState = msg;
58 43
      }
59 44
    },
60 45
    detail(val) {
61
      if(this.payState == 'true'){
62
        if(val.pay_state == '未缴费'){
63
          this.$message("考试缴费还未开启,请稍后操作");
64
        }
65
      }else{
66
        local.set("payDetails", val);
67
        this.$router.push({
68
          path:"/pay_details",
69
        });
70
      }
46
      local.set("payDetails", val);
47
      this.$router.push({
48
        path:"/pay_details",
49
      });
71 50
    },
72 51
    goback() {
73 52
      this.$router.go(-1)

+ 2 - 2
src/views/home/index.vue

@ -90,7 +90,7 @@ export default {
90 90
    border-bottom: 1px solid #f2f2f2;
91 91
  }
92 92
  .home-search /deep/ .el-input {
93
    width: 75%;
93
    width: 74%;
94 94
    margin: 0 auto;
95 95
  }
96 96
  .home-search /deep/ .el-button {
@ -119,7 +119,7 @@ export default {
119 119
  }
120 120
  .footer_img {
121 121
    width: 100%;
122
    margin: .2rem .15rem;
122
    text-align: center;
123 123
    img {
124 124
      margin: 0 .1rem;
125 125
      width: 170px;

client_web - Gogs: Go Git Service

报名考试前端页面(红色页面)

config.js 700B

    // 本地电脑 window.config = { url: 'http://192.168.0.6:8083/rsglxt', routerPath: "http://192.168.0.6:8000/rsglxt", fileServiceURL: "http://10.1.12.96", sysCode: "131452023" } // // 授权电脑 // window.config = { // url: 'http://10.1.99.33:8083/rsglxt', // routerPath: "http://10.1.99.33:8000/rsglxt", // fileServiceURL: "http://10.1.12.96" // } // // 测试服务器 // window.config = { // url: 'http://10.1.12.31:8083/rsglxt', // routerPath: "http://10.1.12.31:8000/rsglxt", // fileServiceURL: "http://10.1.12.96" // } // // yy用 window.config = { url: 'http://192.168.168.46:8081/rsglxt', routerPath: "http://192.168.46.49:8081/rsglxt", }