mirror of https://github.com/halo-dev/halo
refactor: username validation rules for signup form (#5740)
#### What type of PR is this? /area ui /kind improvement /milestone 2.15.x #### What this PR does / why we need it: 优化注册表单的用户名校验规则,改为最低要求 4 个字符,并完善规则提示。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/5733 #### Does this PR introduce a user-facing change? ```release-note 优化注册表单的用户名校验规则 ```pull/5746/head
parent
b05ed5814c
commit
90e3c2c017
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref, onMounted, reactive, computed, type ComputedRef } from "vue";
|
||||
import { computed, type ComputedRef, onMounted, reactive, ref } from "vue";
|
||||
import { submitForm } from "@formkit/core";
|
||||
import { Toast, VButton } from "@halo-dev/components";
|
||||
import { apiClient } from "@/utils/api-client";
|
||||
|
@ -170,7 +170,7 @@ const sendVerifyCodeButtonText = computed(() => {
|
|||
type="text"
|
||||
:validation="[
|
||||
['required'],
|
||||
['length:0,63'],
|
||||
['length', '4', '63'],
|
||||
[
|
||||
'matches',
|
||||
/^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/,
|
||||
|
|
|
@ -915,7 +915,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: Username
|
||||
validation: Please enter a valid username.
|
||||
validation: Can only contain numbers, lowercase letters, periods (.), and hyphens (-), and cannot start or end with a period (.) or hyphen (-).
|
||||
display_name:
|
||||
label: Display name
|
||||
email:
|
||||
|
@ -1113,7 +1113,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: Username
|
||||
validation: Please enter a valid username.
|
||||
validation: Can only contain numbers, lowercase letters, periods (.), and hyphens (-), and cannot start or end with a period (.) or hyphen (-).
|
||||
display_name:
|
||||
label: Display name
|
||||
email:
|
||||
|
|
|
@ -871,7 +871,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: 用户名
|
||||
validation: 请输入有效的用户名
|
||||
validation: 只能包含数字、小写字母、. 和 - 符号,且不能以 . 和 - 符号开头和结尾
|
||||
display_name:
|
||||
label: 显示名称
|
||||
email:
|
||||
|
@ -1061,7 +1061,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: 用户名
|
||||
validation: 请输入有效的用户名
|
||||
validation: 只能包含数字、小写字母、. 和 - 符号,且不能以 . 和 - 符号开头和结尾
|
||||
display_name:
|
||||
label: 显示名称
|
||||
email:
|
||||
|
|
|
@ -859,7 +859,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: 用戶名
|
||||
validation: 請輸入有效的用戶名
|
||||
validation: 只能包含數字、小寫字母、. 和 - 符號,且不能以 . 和 - 符號開頭和結尾。
|
||||
display_name:
|
||||
label: 顯示名稱
|
||||
email:
|
||||
|
@ -1049,7 +1049,7 @@ core:
|
|||
fields:
|
||||
username:
|
||||
label: 用戶名
|
||||
validation: 請輸入有效的用戶名
|
||||
validation: 只能包含數字、小寫字母、. 和 - 符號,且不能以 . 和 - 符號開頭和結尾。
|
||||
display_name:
|
||||
label: 顯示名稱
|
||||
email:
|
||||
|
|
Loading…
Reference in New Issue