Browse Source

公众号登录

he2802 4 năm trước cách đây
mục cha
commit
b5fdd7abd9

+ 5 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.framework.web.service;
 
 
+import cn.hutool.core.lang.Validator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.zhongzheng.common.constant.Constants;
@@ -203,6 +204,10 @@ public class WxLoginService
         if(user==null){
             throw new CustomException("您尚未注册,请前往小程序注册");
         }
+        if(!Validator.isNotNull(user.getGzhOpenId())){
+            user.setGzhOpenId(openId);
+            iUserService.updateById(user);
+        }
         return user;
     }