作者 xwp
1 个管道 的构建 通过 耗费 11 秒

默认学生

... ... @@ -19,7 +19,7 @@ use think\Hook;
*/
class User extends Api
{
protected $noNeedLogin = ['miniLogin', 'miniLogin1','register','get_openid','sendVerifyCode','get_id','get_order','get_openid'];
protected $noNeedLogin = ['miniLogin', 'miniLogin1','register','get_openid','sendVerifyCode'];
protected $noNeedRight = '*';
protected $config;
... ... @@ -325,15 +325,19 @@ class User extends Api
$this->error(__('Invalid parameters'));
}
$ret = $this->auth->direct($new_id);
$user = new \app\admin\model\User;
$user->save(['is_default'=>true],['id'=>$new_id]);
if($old_id != $new_id){
$ret = $this->auth->direct($new_id);
$user = new \app\admin\model\User;
$user->save(['is_default'=>false],['id'=>$old_id]);
$user = new \app\admin\model\User;
$user->save(['is_default'=>false],['id'=>$old_id]);
if (!$ret) {
$this->error($this->auth->getError());
$user = new \app\admin\model\User;
$user->save(['is_default'=>true],['id'=>$new_id]);
if (!$ret) {
$this->error($this->auth->getError());
}
}
$return['user_info'] = $this->auth->getUserinfo();
... ...