fix(core): 统一电话号码字段名称从 phonenumber 改为 phone

This commit is contained in:
dubai
2026-01-11 14:06:04 +08:00
parent d12769dd29
commit 1d78fec144
12 changed files with 27 additions and 27 deletions

View File

@@ -65,7 +65,7 @@ const formSchema = computed((): VbenFormSchema[] => {
componentProps: {
placeholder: $t('authentication.mobile'),
},
fieldName: 'phoneNumber',
fieldName: 'phone',
label: $t('authentication.mobile'),
rules: z
.string()
@@ -89,7 +89,7 @@ const formSchema = computed((): VbenFormSchema[] => {
codeLength: CODE_LENGTH,
placeholder: $t('authentication.code'),
handleSendCode: async () => {
const { valid, value } = await form.validateField('phoneNumber');
const { valid, value } = await form.validateField('phone');
if (!valid) {
// 必须抛异常 不能直接return
throw new Error('未填写手机号');
@@ -114,7 +114,7 @@ async function handleLogin(values: LoginCodeParams) {
try {
const requestParams: any = {
tenantId: values.tenantId,
phonenumber: values.phoneNumber,
phone: values.phone,
smsCode: values.code,
grantType: 'sms',
};

View File

@@ -68,7 +68,7 @@ const [BasicForm, formApi] = useVbenForm({
},
{
component: 'Input',
fieldName: 'phonenumber',
fieldName: 'phone',
label: '电话',
rules: z.string().regex(/^1[3-9]\d{9}$/, '请输入正确的电话'),
},
@@ -106,7 +106,7 @@ onMounted(() => {
'userId',
'nick',
'email',
'phonenumber',
'phone',
'sex',
]);
formApi.setValues(data);

View File

@@ -61,7 +61,7 @@ const poetrySrc = computed(() => {
{{ profile.user.userName }}
</DescriptionsItem>
<DescriptionsItem label="手机号码">
{{ profile.user.phonenumber || '未绑定手机号' }}
{{ profile.user.phone || '未绑定手机号' }}
</DescriptionsItem>
<DescriptionsItem label="邮箱">
{{ profile.user.email || '未绑定邮箱' }}

View File

@@ -9,7 +9,7 @@ export const querySchema: FormSchemaGetter = () => [
},
{
component: 'Input',
fieldName: 'phonenumber',
fieldName: 'phone',
label: '手机号码',
},
];
@@ -30,7 +30,7 @@ export const columns: VxeGridProps['columns'] = [
},
{
title: '手机号',
field: 'phonenumber',
field: 'phone',
},
{
field: 'action',

View File

@@ -308,7 +308,7 @@ function handleSubmit() {
<div class="flex flex-col items-baseline text-[12px]">
<div>{{ row.nick }}</div>
<div class="opacity-50">
{{ row.phonenumber || '暂无手机号' }}
{{ row.phone || '暂无手机号' }}
</div>
</div>
</div>
@@ -340,7 +340,7 @@ function handleSubmit() {
{{ row.nick }}
</div>
<div class="opacity-50">
{{ row.phonenumber || '暂无手机号' }}
{{ row.phone || '暂无手机号' }}
</div>
</div>
</div>