mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-02 16:57:11 +08:00
重构:重构登录页面前端代码
This commit is contained in:
@@ -2,25 +2,29 @@ import axios from 'axios';
|
||||
import type { RouteRecordNormalized } from 'vue-router';
|
||||
import { UserState } from '@/store/modules/login/types';
|
||||
|
||||
const BASE_URL = '/auth';
|
||||
|
||||
export interface LoginReq {
|
||||
username: string;
|
||||
password: string;
|
||||
captcha: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface LoginRes {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export function login(req: LoginReq) {
|
||||
return axios.post<LoginRes>('/auth/login', req);
|
||||
return axios.post<LoginRes>(`${BASE_URL}/login`, req);
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return axios.post('/auth/logout');
|
||||
return axios.post(`${BASE_URL}/logout`);
|
||||
}
|
||||
|
||||
export function getUserInfo() {
|
||||
return axios.get<UserState>('/auth/user/info');
|
||||
return axios.get<UserState>(`${BASE_URL}/user/info`);
|
||||
}
|
||||
|
||||
export function getMenuList() {
|
||||
|
||||
Reference in New Issue
Block a user