Kaynağa Gözat

修复自动激活账号的处理Bug

seyason 2 yıl önce
ebeveyn
işleme
2420e39522

+ 6 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -491,21 +491,21 @@ public class WeiXinCorpController {
                     // "ExpireTime":1671465600,"ActiveCode":"LA10000001400000163774145"},
                     // "ServiceCorpId":"wwf11426cf618e1703",
                     // "AuthCorpId":"wpy9TkCAAA6ii2OYKAEj5rCEqjwEQSuA","TimeStamp":1668761791}}
+                    String corpId = jsonObject.getString("AuthCorpId");
                     org.json.JSONObject authUserJson = jsonObject.getJSONObject("AccountList");
                     String authUserId = authUserJson.getString("UserId");
                     User oneUser = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_userid", authUserId));
                     if (oneUser == null) {
                         //生成该用户
-                        String corpId = authUserJson.getString("AuthCorpId");
                         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
                         if (wxCorpInfo != null) {
                             Integer companyId = wxCorpInfo.getCompanyId();
                             SysRole defaultRole = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", companyId).eq("is_default", 1));
-                            String corpWxUserId = jsonObject.getString("UserID");
-                            String openUserId = jsonObject.getString("OpenUserID");
+
                             if (wxCorpInfo.getSaasSyncContact() == 1) {
                                 //直接通过企业微信通讯录同步
-                                JSONObject userObj = getUserInfo(getCorpAccessToken(wxCorpInfo), corpWxUserId);
+                                JSONObject userObj = getUserInfo(getCorpAccessToken(wxCorpInfo), authUserId);
+                                System.out.println("userObj=="+userObj);
                                 //成功获取到通讯录的个人详情
                                 Long id = SnowFlake.nextId();
                                 //通过getUserInfo接口获取到的json key是小写的
@@ -513,6 +513,7 @@ public class WeiXinCorpController {
                                 Integer curUserWXDeptid = getMaxDeptIdFromArray(department);
                                 Department sysDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", curUserWXDeptid));
                                 String userId = userObj.getString("userid");
+                                String openUserId = userObj.getString("open_userid");
                                 User user = new User()
                                         .setId(id.toString())
                                         .setRoleId(defaultRole.getId())
@@ -521,7 +522,7 @@ public class WeiXinCorpController {
                                         .setPhone(userObj.getString("mobile"))
                                         .setPassword(MD5Util.getPassword("000000"))
                                         .setCorpwxUserid(openUserId)
-                                        .setCorpwxRealUserid(corpWxUserId)
+                                        .setCorpwxRealUserid(userId)
                                         .setJobNumber(openUserId.equals(userId)?null:userId)
                                         .setColor(ColorUtil.randomColor())
                                         .setCompanyId(companyId);

+ 3 - 1
fhKeeper/formulahousekeeper/timesheet_h5/public/index.html

@@ -21,10 +21,12 @@
 
     <meta name="wpk-bid" content="dta_2_71020">
         <script>
-        var isDingtalk = navigator && /DingTalk/.test(navigator.userAgent);var isProductEnv = window &&window.location &&window.location.host 
+        var isDingtalk = navigator && /DingTalk/.test(navigator.userAgent);
+        var isProductEnv = window &&window.location &&window.location.host 
         && window.location.host.indexOf('//127.0.0.1')===-1
         && window.location.host.indexOf('//localhost')===-1
         && window.location.host.indexOf('//192.168.')===-1
+        && window.location.host.indexOf('//mldworktime')===-1
         // 如果有其它测试域名,请一起排掉,减少测试环境对生产环境监控的干扰
         if (isProductEnv) {    !(function(c,i,e,b){var h=i.createElement("script");var f=i.getElementsByTagName("script")[0];h.type="text/javascript";h.crossorigin=true;h.onload=function(){c[b]||(c[b]=new c.wpkReporter({bid:"dta_2_71020"}));c[b].installAll()};f.parentNode.insertBefore(h,f);h.src=e})(window,document,"https://g.alicdn.com/woodpeckerx/jssdk??wpkReporter.js","__wpk"); }
     </script>