From eaad703a545ecc8ce12bb1ce2dd135247005afba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Thu, 31 Aug 2023 13:27:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E5=8F=96=E6=B6=88=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lang/en/account.php | 1 - app/api/lang/zh-cn/account.php | 1 - app/api/validate/Account.php | 4 +--- web/src/views/frontend/user/account/profile.vue | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/api/lang/en/account.php b/app/api/lang/en/account.php index b4ac2a32..20102228 100644 --- a/app/api/lang/en/account.php +++ b/app/api/lang/en/account.php @@ -1,6 +1,5 @@ 'Avatar', 'username' => 'Username', 'nickname' => 'Nickname', 'birthday' => 'Birthday', diff --git a/app/api/lang/zh-cn/account.php b/app/api/lang/zh-cn/account.php index eb71daf5..ebfd926c 100644 --- a/app/api/lang/zh-cn/account.php +++ b/app/api/lang/zh-cn/account.php @@ -1,6 +1,5 @@ '头像', 'username' => '用户名', 'nickname' => '昵称', 'birthday' => '生日', diff --git a/app/api/validate/Account.php b/app/api/validate/Account.php index d9c846a6..fd0a41a1 100644 --- a/app/api/validate/Account.php +++ b/app/api/validate/Account.php @@ -9,7 +9,6 @@ class Account extends Validate protected $failException = true; protected $rule = [ - 'avatar' => 'require', 'username' => 'require|regex:^[a-zA-Z][a-zA-Z0-9_]{2,15}$|unique:user', 'nickname' => 'require|chsDash', 'birthday' => 'date', @@ -24,7 +23,7 @@ class Account extends Validate * 验证场景 */ protected $scene = [ - 'edit' => ['avatar', 'username', 'nickname', 'birthday'], + 'edit' => ['username', 'nickname', 'birthday'], 'changePassword' => ['password'], 'retrievePassword' => ['account', 'captcha', 'password'], ]; @@ -32,7 +31,6 @@ class Account extends Validate public function __construct() { $this->field = [ - 'avatar' => __('avatar'), 'username' => __('username'), 'nickname' => __('nickname'), 'birthday' => __('birthday'), diff --git a/web/src/views/frontend/user/account/profile.vue b/web/src/views/frontend/user/account/profile.vue index c3e713d8..1faba84d 100644 --- a/web/src/views/frontend/user/account/profile.vue +++ b/web/src/views/frontend/user/account/profile.vue @@ -301,7 +301,6 @@ const state: { formSubmitLoading: false, form: userInfo.$state, rules: { - avatar: [buildValidatorData({ name: 'required', message: t('Please select field', { field: t('user.account.profile.head portrait') }) })], username: [buildValidatorData({ name: 'required', title: t('user.account.profile.User name') }), buildValidatorData({ name: 'account' })], nickname: [buildValidatorData({ name: 'required', title: t('user.account.profile.nickname') })], },