Skip to content

Commit

Permalink
chore: 优化部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Dec 26, 2024
1 parent bc3a5cf commit f0dff8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/apis/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ export const getUserInfo = () => {

/** @desc 获取路由信息 */
export const getUserRoute = () => {
return http.get<T.RouteItem[]>(`${BASE_URL}/route`)
return http.get<T.RouteItem[]>(`${BASE_URL}/user/route`)
}
8 changes: 4 additions & 4 deletions src/apis/auth/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/stores/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f0dff8b

Please sign in to comment.