1.提交缺失的东西

This commit is contained in:
2025-05-14 17:39:27 +08:00
parent 09353673c6
commit b69e26de96
2 changed files with 4 additions and 4 deletions

View File

@ -272,13 +272,13 @@ class AccountController extends BaseApiController
{
$post = $this->request->post();
if (!isset($post['avatar']) || empty($post['avatar'])) {
$this->fail('参数缺失');
return $this->fail('参数缺失');
}
if (!isset($post['nickname']) || empty($post['nickname'])) {
$this->fail('参数缺失');
return $this->fail('参数缺失');
}
$data = LoginLogic::updateUser($post,$this->userId);
$this->success($data['msg'], $data['data'], $data['code'], $data['show']);
return $this->success("操作成功",$data);
}
/**

View File

@ -705,7 +705,7 @@ class LoginLogic extends LogicBase
// return self::dataError('非新用户无法使用此接口更新用户信息');
// }
Db::name('user')->where(['id'=>$user_id])->update(['nickname'=>$post['nickname'],'avatar'=>UrlServer::setFileUrl($post['avatar']),'is_new_user'=>0]);
return self::dataSuccess('操作成功');
return true;
}