正在显示
1 个修改的文件
包含
9 行增加
和
3 行删除
@@ -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 |
-
请 注册 或 登录 后发表评论