2
0

fix:添加查询是否注册,页面问题修复

This commit is contained in:
zhongzm
2024-11-29 18:07:43 +08:00
parent 4cbdc12f90
commit 8f198f789d
7 changed files with 155 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ import { localStg } from '@/utils/storage';
import { $t } from '@/locales';
import { useRouteStore } from '../route';
import { clearAuthStorage, emptyInfo, getToken } from './shared';
import {sendCaptcha} from "@/service/api/auth";
import {doCheckUserRepeat, sendCaptcha} from "@/service/api/auth";
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const routeStore = useRouteStore();
@@ -122,6 +122,16 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
}
return false;
}
//check User
/**
* 检查用户信息是否已存在
*/
async function checkUserRepeat(checkForm:Api.Auth.CheckBody) {
const { data, error } = await doCheckUserRepeat(checkForm);
return { exists: data, error };
}
/**
* Register new user
*/
@@ -163,5 +173,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
refreshUserInfo,
register,
captcha,
checkUserRepeat,
};
});