fix(core): 统一电话号码字段名称从 phonenumber 改为 phone
This commit is contained in:
@@ -2,12 +2,12 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
* @param phonenumber 手机号
|
||||
* @param phone 手机号
|
||||
* @returns void
|
||||
*/
|
||||
export function sendSmsCode(phonenumber: string) {
|
||||
export function sendSmsCode(phone: string) {
|
||||
return requestClient.get<void>('/resource/sms/code', {
|
||||
params: { phonenumber },
|
||||
params: { phone },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface User {
|
||||
loginDate: string;
|
||||
loginIp: string;
|
||||
nick: string;
|
||||
phonenumber: string;
|
||||
phone: string;
|
||||
remark: string;
|
||||
roles: Role[];
|
||||
sex: string;
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface User {
|
||||
nick: string;
|
||||
userType: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
phone: string;
|
||||
sex: string;
|
||||
avatar: string;
|
||||
status: string;
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 || '未绑定邮箱' }}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user