fix:短信登录功能修复

This commit is contained in:
ktianc 2023-06-19 14:19:55 +08:00
parent 7f4c0d3fa1
commit f9cc24e84c
4 changed files with 17 additions and 18 deletions

View File

@ -74,6 +74,7 @@ const schema = reactive<FormSchema[]>([
field: 'method', field: 'method',
label: '登录类型', label: '登录类型',
value: '0', value: '0',
component: 'Input',
ifshow: () => false ifshow: () => false
}, },
{ {
@ -143,7 +144,7 @@ const signIn = async () => {
} else { } else {
loading.value = false loading.value = false
} }
} finally { } catch (e: any) {
loading.value = false loading.value = false
} }
} }

View File

@ -56,6 +56,7 @@ const schema = reactive<FormSchema[]>([
field: 'method', field: 'method',
label: '登录类型', label: '登录类型',
value: '1', value: '1',
component: 'Input',
ifshow: () => false ifshow: () => false
}, },
{ {
@ -111,7 +112,7 @@ const telephoneCodeLogin = async () => {
} else { } else {
loading.value = false loading.value = false
} }
} finally { } catch (e: any) {
loading.value = false loading.value = false
} }
} }
@ -129,7 +130,6 @@ const getSMSCode = async () => {
SMSCodeNumber.value = 60 SMSCodeNumber.value = 60
const { getFormData } = methods const { getFormData } = methods
const formData = await getFormData<UserLoginType>() const formData = await getFormData<UserLoginType>()
try {
const res = await postSMSCodeApi({ telephone: formData.telephone }) const res = await postSMSCodeApi({ telephone: formData.telephone })
if (res?.data) { if (res?.data) {
let timer = setInterval(() => { let timer = setInterval(() => {
@ -143,9 +143,6 @@ const getSMSCode = async () => {
ElMessage.error('发送失败,请联系管理员') ElMessage.error('发送失败,请联系管理员')
SMSCodeStatus.value = true SMSCodeStatus.value = true
} }
} finally {
SMSCodeStatus.value = true
}
} }
}) })
} }

View File

@ -110,7 +110,7 @@ const save = async () => {
} else { } else {
loading.value = false loading.value = false
} }
} finally { } catch (e: any) {
loading.value = false loading.value = false
} }
} }

View File

@ -122,6 +122,7 @@ export const schema = reactive<FormSchema[]>([
colProps: { colProps: {
span: 24 span: 24
}, },
component: 'Input',
ifshow: (values) => values.menu_type !== '2' ifshow: (values) => values.menu_type !== '2'
}, },
{ {