Kaynağa Gözat

登录修改openid

lizhen_gitee 2 ay önce
ebeveyn
işleme
4b254bb13f
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  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 {