Browse Source

登录修改openid

lizhen_gitee 2 months ago
parent
commit
4b254bb13f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      application/api/controller/User.php

+ 3 - 0
application/api/controller/User.php

@@ -64,6 +64,9 @@ class User extends Api
             if ($userInfo['status'] != 1) {
                 $this->error(__('Account is locked'));
             }
+            if(empty($userInfo['wxmini_openid'])){
+                Db::name('user')->where('id',$userInfo['id'])->update(['wxmini_openid'=>$openid]);
+            }
             //如果已经有账号则直接登录
             $res = $this->auth->direct($userInfo['id']);
         } else {