浏览代码

修改登录信息为OKR项目本身的

hcst_sunzhen 4 年之前
父节点
当前提交
6ae9a9243b
共有 1 个文件被更改,包括 11 次插入10 次删除
  1. 11 10
      src/main/java/cn/com/ctop/okr/controller/LoginController.java

+ 11 - 10
src/main/java/cn/com/ctop/okr/controller/LoginController.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.okr.controller;
 
 import cn.com.ctop.okr.entity.QYWxUserInfo;
+import cn.com.ctop.okr.qywx.constant.QYWxConstant;
 import cn.com.ctop.okr.service.CorpUserInfoService;
 import cn.com.ctop.okr.service.QYWxService;
 import cn.com.ctop.okr.utils.JwtUtil;
@@ -102,23 +103,23 @@ public class LoginController {
     public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code) throws Exception {
         Result<JSONObject> result = new Result<>();
         val configStorage = new WxCpDefaultConfigImpl();
-        //configStorage.setCorpId(QYWxConstant.QYWX_CORP_ID);
-        //configStorage.setAgentId(QYWxConstant.QYWX_AGENT_ID);
-        //configStorage.setCorpSecret(QYWxConstant.QYWX_CORP_SECRET);
-        //configStorage.setToken("hcst2019");
-        //configStorage.setAesKey("hcst2019");
-
-        configStorage.setCorpId("ww24b8a47826f5875f");
-        configStorage.setAgentId(1000002);
-        configStorage.setCorpSecret("MJIlySADGPlgvADnkFQPUpfZD4yV-4WN6066OgNnb0s");
+        configStorage.setCorpId(QYWxConstant.QYWX_CORP_ID);
+        configStorage.setAgentId(QYWxConstant.QYWX_AGENT_ID);
+        configStorage.setCorpSecret(QYWxConstant.QYWX_CORP_SECRET);
         configStorage.setToken("hcst2019");
         configStorage.setAesKey("hcst2019");
+
+        //configStorage.setCorpId("ww24b8a47826f5875f");
+        //configStorage.setAgentId(1000002);
+        //configStorage.setCorpSecret("MJIlySADGPlgvADnkFQPUpfZD4yV-4WN6066OgNnb0s");
+        //configStorage.setToken("hcst2019");
+        //configStorage.setAesKey("hcst2019");
         val service = new WxCpServiceImpl();
 
         service.setWxCpConfigStorage(configStorage);
         WxCpOAuth2Service wxCpOAuth2Service = service.getOauth2Service();
         try {
-            WxCpOauth2UserInfo userInfo = wxCpOAuth2Service.getUserInfo(1000002, code);
+            WxCpOauth2UserInfo userInfo = wxCpOAuth2Service.getUserInfo(QYWxConstant.QYWX_AGENT_ID, code);
             if (userInfo != null && userInfo.getUserId() != null) {
                 //WxCpUserService wxCpUserService = new WxCpUserServiceImpl(service);
                 //WxCpUser user = wxCpUserService.getById(userInfo.getUserId());