fix: 注册功能接口变更
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { computed } from 'vue';
|
||||
import { useCountDown, useLoading } from '@sa/hooks';
|
||||
import { $t } from '@/locales';
|
||||
import {REG_EMAIL} from '@/constants/reg';
|
||||
import {useAuthStore} from "@/store/modules/auth";
|
||||
import { REG_EMAIL } from '@/constants/reg';
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
|
||||
export function useCaptcha() {
|
||||
const { loading, startLoading, endLoading } = useLoading();
|
||||
@@ -39,20 +39,17 @@ export function useCaptcha() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//获取验证码方法
|
||||
async function getCaptcha(email: string) {
|
||||
console.log(email)
|
||||
//const valid = isPhoneValid(phone);
|
||||
const valid = isEmailValid(email);
|
||||
const valid = isEmailValid(email);
|
||||
if (!valid || loading.value) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
startLoading();
|
||||
|
||||
await authStore.captcha(
|
||||
email,
|
||||
);
|
||||
const data = await authStore.captcha(email);
|
||||
await new Promise(resolve => {
|
||||
setTimeout(resolve, 500);
|
||||
});
|
||||
@@ -62,6 +59,7 @@ export function useCaptcha() {
|
||||
start();
|
||||
|
||||
endLoading();
|
||||
return data;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user