refactor:取消前台用户头像必填

This commit is contained in:
妙码生花 2023-08-31 13:27:20 +08:00
parent 1375ac6a95
commit eaad703a54
4 changed files with 1 additions and 6 deletions

View File

@ -1,6 +1,5 @@
<?php
return [
'avatar' => 'Avatar',
'username' => 'Username',
'nickname' => 'Nickname',
'birthday' => 'Birthday',

View File

@ -1,6 +1,5 @@
<?php
return [
'avatar' => '头像',
'username' => '用户名',
'nickname' => '昵称',
'birthday' => '生日',

View File

@ -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'),

View File

@ -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') })],
},