🔨 修改路由配置.

This commit is contained in:
lijiahangmax
2024-12-11 22:47:56 +08:00
parent 32e4859ba7
commit f52a81f9d0
35 changed files with 552 additions and 225 deletions

View File

@@ -1,4 +1,3 @@
import type { MenuQueryResponse } from '@/api/system/menu';
import axios from 'axios';
/**
@@ -17,45 +16,15 @@ export interface LoginResponse {
}
/**
* 用户权限响应
* 用户登录
*/
export interface UserPermissionResponse {
user: {
id: number;
username: string;
nickname: string;
avatar: string;
systemPreference: Record<string, any>;
tippedKeys: Array<string>;
};
roles: Array<string>;
permissions: Array<string>;
}
/**
* 登录
*/
export function login(data: LoginRequest) {
export function userLogin(data: LoginRequest) {
return axios.post<LoginResponse>('/infra/auth/login', data);
}
/**
* 登出
* 用户登出
*/
export function logout() {
export function userLogout() {
return axios.get('/infra/auth/logout');
}
/**
* 获取用户信息
*/
export function getUserPermission() {
return axios.get<UserPermissionResponse>('/infra/user-permission/user');
}
/**
* 获取菜单列表
*/
export function getMenuList() {
return axios.get<Array<MenuQueryResponse>>('/infra/user-permission/menu');
}

View File

@@ -9,6 +9,7 @@ import axios from 'axios';
export interface UserUpdatePasswordRequest {
beforePassword?: string;
password?: string;
checkPassword?: string;
}
/**

View File

@@ -0,0 +1,39 @@
import type { MenuQueryResponse } from '@/api/system/menu';
import axios from 'axios';
/**
* 用户权限响应
*/
export interface UserPermissionResponse {
user: UserBaseResponse;
roles: Array<string>;
permissions: Array<string>;
systemPreference: Record<string, any>;
tippedKeys: Array<string>;
}
/**
* 用户基础信息
*/
export interface UserBaseResponse {
id: number;
username: string;
nickname: string;
avatar: string;
passwordUpdateStatus: number;
passwordUpdateReason: string;
}
/**
* 获取用户信息
*/
export function getUserPermission() {
return axios.get<UserPermissionResponse>('/infra/user-permission/user');
}
/**
* 获取菜单列表
*/
export function getUserMenuList() {
return axios.get<Array<MenuQueryResponse>>('/infra/user-permission/menu');
}