From 617d05f3bc9c0cf825a76f0259a59aaf11d76263 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 21 Jul 2023 17:04:14 +0800 Subject: [PATCH] refactor: remove username input validation rule in user editing form (#4276) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area console /kind improvement /milestone 2.8.x #### What this PR does / why we need it: 移除用户编辑表单中用户名的校验规则,在这个表单中,用户名本身就是不能修改的,所以不需要验证。移除之后还能够解决旧版本 Halo 升级之后无法修改资料的问题。(旧版本没有用户名校验) #### Which issue(s) this PR fixes: Fixes #4269 #### Does this PR introduce a user-facing change? ```release-note 移除 Console 端用户编辑表单中用户名的校验规则,防止旧版本 Halo 升级之后无法修改资料。 ``` --- .../system/users/components/UserEditingModal.vue | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/console/src/modules/system/users/components/UserEditingModal.vue b/console/src/modules/system/users/components/UserEditingModal.vue index 435d81300..7c057081c 100644 --- a/console/src/modules/system/users/components/UserEditingModal.vue +++ b/console/src/modules/system/users/components/UserEditingModal.vue @@ -159,19 +159,6 @@ const handleUpdateUser = async () => { :label="$t('core.user.editing_modal.fields.username.label')" type="text" name="name" - :validation="[ - ['required'], - ['length:0,63'], - [ - 'matches', - /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, - ], - ]" - :validation-messages="{ - matches: $t( - 'core.user.editing_modal.fields.username.validation' - ), - }" >