fix:短信登录功能修复
This commit is contained in:
parent
7f4c0d3fa1
commit
f9cc24e84c
@ -74,6 +74,7 @@ const schema = reactive<FormSchema[]>([
|
||||
field: 'method',
|
||||
label: '登录类型',
|
||||
value: '0',
|
||||
component: 'Input',
|
||||
ifshow: () => false
|
||||
},
|
||||
{
|
||||
@ -143,7 +144,7 @@ const signIn = async () => {
|
||||
} else {
|
||||
loading.value = false
|
||||
}
|
||||
} finally {
|
||||
} catch (e: any) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ const schema = reactive<FormSchema[]>([
|
||||
field: 'method',
|
||||
label: '登录类型',
|
||||
value: '1',
|
||||
component: 'Input',
|
||||
ifshow: () => false
|
||||
},
|
||||
{
|
||||
@ -111,7 +112,7 @@ const telephoneCodeLogin = async () => {
|
||||
} else {
|
||||
loading.value = false
|
||||
}
|
||||
} finally {
|
||||
} catch (e: any) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
@ -129,21 +130,17 @@ const getSMSCode = async () => {
|
||||
SMSCodeNumber.value = 60
|
||||
const { getFormData } = methods
|
||||
const formData = await getFormData<UserLoginType>()
|
||||
try {
|
||||
const res = await postSMSCodeApi({ telephone: formData.telephone })
|
||||
if (res?.data) {
|
||||
let timer = setInterval(() => {
|
||||
SMSCodeNumber.value--
|
||||
if (SMSCodeNumber.value < 1) {
|
||||
SMSCodeStatus.value = true
|
||||
clearInterval(timer)
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
ElMessage.error('发送失败,请联系管理员')
|
||||
SMSCodeStatus.value = true
|
||||
}
|
||||
} finally {
|
||||
const res = await postSMSCodeApi({ telephone: formData.telephone })
|
||||
if (res?.data) {
|
||||
let timer = setInterval(() => {
|
||||
SMSCodeNumber.value--
|
||||
if (SMSCodeNumber.value < 1) {
|
||||
SMSCodeStatus.value = true
|
||||
clearInterval(timer)
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
ElMessage.error('发送失败,请联系管理员')
|
||||
SMSCodeStatus.value = true
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ const save = async () => {
|
||||
} else {
|
||||
loading.value = false
|
||||
}
|
||||
} finally {
|
||||
} catch (e: any) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
@ -122,6 +122,7 @@ export const schema = reactive<FormSchema[]>([
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
component: 'Input',
|
||||
ifshow: (values) => values.menu_type !== '2'
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user