作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

合并分支 'Branch_liuzhen' 到 'master'

Branch liuzhen



查看合并请求 !288
@@ -957,9 +957,15 @@ class User extends Api @@ -957,9 +957,15 @@ class User extends Api
957 $user = $this->auth->getUser(); 957 $user = $this->auth->getUser();
958 $nickname = $this->request->request('nickname'); 958 $nickname = $this->request->request('nickname');
959 $avatar = $this->request->request('avatar', '', 'trim,strip_tags,htmlspecialchars'); 959 $avatar = $this->request->request('avatar', '', 'trim,strip_tags,htmlspecialchars');
960 - $user->nickname = $nickname;  
961 - $user->avatar = $avatar;  
962 - $user->save(); 960 + if($nickname || $avatar) {
  961 + if($nickname) {
  962 + $user->nickname = $nickname;
  963 + }
  964 + if($avatar) {
  965 + $user->avatar = $avatar;
  966 + }
  967 + $user->save();
  968 + }
963 $this->success(); 969 $this->success();
964 } 970 }
965 971