lizhen_gitee 2 місяців тому
батько
коміт
4b254bb13f
1 змінених файлів з 3 додано та 0 видалено
  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 {