2
0

fix: 注册功能接口变更

This commit is contained in:
TsMask
2024-11-30 17:31:47 +08:00
parent 8f198f789d
commit 5e54aaf24d
5 changed files with 231 additions and 213 deletions

View File

@@ -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 {