Browse Source

feat:版本

super-yimizi 2 months ago
parent
commit
ecf1024b15
2 changed files with 5 additions and 5 deletions
  1. 3 3
      application/api/controller/User.php
  2. 2 2
      application/api/validate/User.php

+ 3 - 3
application/api/controller/User.php

@@ -92,12 +92,12 @@ class User extends Base
             $this->error($validate->getError());
         }
         $username = $params['username'] ?? '';
-        $avatar   = $params['avatar'];
+        // $avatar   = $params['avatar'];
         $nickname = $params['nickname'];
         $bio      = $params['bio'] ??'';
         $age = $params['age'];
         $gender = $params['gender'];
-        $avatar = str_replace(cdnurl('', true), '', $avatar);
+       // $avatar = str_replace(cdnurl('', true), '', $avatar);
         // username 不传,则不修改
         if ($username) {
             $user->username = $username;
@@ -110,7 +110,7 @@ class User extends Base
             $user->bio = $bio;
         }
         $user->nickname = $nickname;
-        $user->avatar = $avatar;
+        // $user->avatar = $avatar;
         $user->age = $age;
         $user->gender = $gender;
         $user->save();

+ 2 - 2
application/api/validate/User.php

@@ -27,7 +27,7 @@ class User extends Validate
         // 验证头像  验证文件后缀
 
         'avatar'    => [
-            'require',
+            // 'require',
             'regex'=>'/^\/uploads\/.+\\.(?:jpg|jpeg|png|gif|bmp|webp)$/i'
         ],
 
@@ -56,7 +56,7 @@ class User extends Validate
         'mobile.regex'      => '手机号格式不正确',
         'mobile.require'    => '手机号不能为空',
         'email'             => '邮箱格式不正确',
-        'avatar.require'    => '头像不能为空',
+        // 'avatar.require'    => '头像不能为空',
         'avatar.regex'      => '头像格式不正确',
         'gender.in'         => '性别只能是未知、男、女',
         'gender.require'    => '性别不能为空',