diff --git a/src/apis/auth/index.ts b/src/apis/auth/index.ts index 4695757..bde5040 100644 --- a/src/apis/auth/index.ts +++ b/src/apis/auth/index.ts @@ -42,5 +42,5 @@ export const getUserInfo = () => { /** @desc 获取路由信息 */ export const getUserRoute = () => { - return http.get(`${BASE_URL}/route`) + return http.get(`${BASE_URL}/user/route`) } diff --git a/src/apis/auth/type.ts b/src/apis/auth/type.ts index a8a42e4..09afcea 100644 --- a/src/apis/auth/type.ts +++ b/src/apis/auth/type.ts @@ -43,10 +43,10 @@ export interface RouteItem { /** 认证类型 */ export enum AuthTypeEnum { - ACCOUNT = 'account', - PHONE = 'phone', - EMAIL = 'email', - SOCIAL_AUTH = 'socialAuth', + ACCOUNT = 'ACCOUNT', + PHONE = 'PHONE', + EMAIL = 'EMAIL', + SOCIAL = 'SOCIAL', } export interface AuthReq { clientId: string diff --git a/src/stores/modules/user.ts b/src/stores/modules/user.ts index c8e5895..6964ee7 100644 --- a/src/stores/modules/user.ts +++ b/src/stores/modules/user.ts @@ -72,7 +72,7 @@ const storeSetup = () => { // 三方账号登录 const socialLogin = async (source: string, req: any) => { - const res = await socialLoginApi({ ...req, source, clientId: import.meta.env.VITE_CLIENT_ID, authType: AuthTypeEnum.SOCIAL_AUTH }) + const res = await socialLoginApi({ ...req, source, clientId: import.meta.env.VITE_CLIENT_ID, authType: AuthTypeEnum.SOCIAL }) setToken(res.data.token) token.value = res.data.token }