sql: sys_user.phone 非空并清理无手机号测试账号

This commit is contained in:
2026-09-23 12:14:04 +08:00
parent f40788db9a
commit e9aeef7607
14 changed files with 46 additions and 56 deletions
@@ -26,7 +26,7 @@ export namespace AccountVO {
/** 登录用户名(可空) */
username?: string | null;
/** 手机号码 */
phone?: string;
phone: string;
/** 用户姓名 */
realName: string;
/** 头像路径 */
+2 -2
View File
@@ -17,7 +17,7 @@ export namespace AuthApi {
/** 注册接口参数 */
export interface RegisterParams {
username?: string;
phone?: string;
phone: string;
password: string;
}
@@ -39,7 +39,7 @@ export namespace AuthApi {
departmentId?: number;
positionId?: number;
username?: string | null;
phone?: string;
phone: string;
realName: string;
avatar?: string;
role: string;
@@ -22,7 +22,7 @@ export namespace SuperAccountVO {
/** 登录用户名(可空) */
username?: string | null;
/** 手机号码 */
phone?: string;
phone: string;
/** 用户姓名 */
realName: string;
/** 头像路径 */
@@ -21,7 +21,7 @@ export namespace UserVO {
/** 登录用户名(可空) */
username?: string | null;
/** 手机号码 */
phone?: string;
phone: string;
/** 用户名称 */
realName: string;
/** 头像路径 */
@@ -27,20 +27,16 @@ const formSchema = computed((): VbenFormSchema[] => {
{
component: 'VbenInput',
componentProps: {
placeholder: '请输入手机号(可选)',
placeholder: '请输入手机号',
},
fieldName: 'phone',
label: '手机号',
rules: z
.string()
.optional()
.refine(
(value) => {
if (!value) return true;
return /^1[3-9]\d{9}$/.test(value);
},
{ message: '请输入正确的手机号格式' },
),
.min(1, { message: '请输入手机号' })
.refine((value) => /^1[3-9]\d{9}$/.test(value), {
message: '请输入正确的手机号格式',
}),
},
{
component: 'VbenInputPassword',
@@ -102,15 +98,7 @@ const formSchema = computed((): VbenFormSchema[] => {
});
function handleSubmit(value: Recordable<any>) {
// 验证至少填写一个登录方式
if (!value.username && !value.phone) {
// 这里可以添加错误提示
return;
}
// 移除不需要的字段
const { ...registerData } = value;
const { confirmPassword: _, agreePolicy: __, ...registerData } = value;
authStore.authRegister(registerData);
}
</script>
@@ -239,7 +239,14 @@ fetchUserInfo();
</Form.Item>
<!-- 手机号 -->
<Form.Item label="手机号" name="phone">
<Form.Item
label="手机号"
name="phone"
:rules="[
{ required: true, message: '请输入手机号' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入有效的手机号' },
]"
>
<Input
v-model:value="formData.phone"
placeholder="请输入手机号"