fix: 注册功能接口变更
This commit is contained in:
@@ -7,7 +7,7 @@ import { localStg } from '@/utils/storage';
|
||||
import { $t } from '@/locales';
|
||||
import { useRouteStore } from '../route';
|
||||
import { clearAuthStorage, emptyInfo, getToken } from './shared';
|
||||
import {doCheckUserRepeat, sendCaptcha} from "@/service/api/auth";
|
||||
import { doCheckUserRepeat, sendCaptcha } from '@/service/api/auth';
|
||||
|
||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
const routeStore = useRouteStore();
|
||||
@@ -122,12 +122,11 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//check User
|
||||
|
||||
/**
|
||||
* 检查用户信息是否已存在
|
||||
*/
|
||||
async function checkUserRepeat(checkForm:Api.Auth.CheckBody) {
|
||||
async function checkUserRepeat(checkForm: Api.Auth.CheckBody) {
|
||||
const { data, error } = await doCheckUserRepeat(checkForm);
|
||||
return { exists: data, error };
|
||||
}
|
||||
@@ -149,16 +148,13 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
endLoading();
|
||||
return !error;
|
||||
}
|
||||
async function captcha(email:string){
|
||||
|
||||
async function captcha(email: string) {
|
||||
if (!email) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await sendCaptcha({ email }); // 这里调用后端接口发送验证码
|
||||
} catch (error) {
|
||||
|
||||
return null;
|
||||
}
|
||||
const { data, error } = await sendCaptcha({ email }); // 这里调用后端接口发送验证码
|
||||
return { data, error };
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -173,6 +169,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
refreshUserInfo,
|
||||
register,
|
||||
captcha,
|
||||
checkUserRepeat,
|
||||
checkUserRepeat
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user