refactor: permission (#357)

* refactor: permission

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* fix: 修复`mix`混合模式导航在生产环境左侧菜单一定机率不显示的问题

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update

* chore: update
This commit is contained in:
RealityBoy
2022-10-25 12:17:13 +08:00
committed by GitHub
parent cedc84d31a
commit 6ef4cf9fb6
47 changed files with 605 additions and 386 deletions

View File

@@ -1,12 +1,11 @@
import { http } from "../utils/http";
type Result = {
success: boolean;
data?: {
/** 列表数据 */
list: Array<any>;
};
code?: number;
msg?: string;
};
/** 卡片列表 */

View File

@@ -1,8 +1,8 @@
import { http } from "../utils/http";
type Result = {
code: number;
info: Array<any>;
success: boolean;
data: Array<any>;
};
/** 地图数据 */

View File

@@ -1,10 +1,10 @@
import { http } from "../utils/http";
type Result = {
code: number;
info: Array<any>;
success: boolean;
data: Array<any>;
};
export const getAsyncRoutes = (params?: object) => {
return http.request<Result>("get", "/getAsyncRoutes", { params });
export const getAsyncRoutes = () => {
return http.request<Result>("get", "/getAsyncRoutes");
};

View File

@@ -1,14 +1,13 @@
import { http } from "../utils/http";
type Result = {
success: boolean;
data?: {
/** 列表数据 */
list: Array<any>;
/** 总数 */
total: number;
total?: number;
};
code?: number;
msg?: string;
};
/** 获取用户管理列表 */

View File

@@ -1,26 +1,39 @@
import { http } from "../utils/http";
type Result = {
svg?: string;
code?: number;
info?: object;
export type UserResult = {
success: boolean;
data: {
/** 用户名 */
username: string;
/** 当前登陆用户的角色 */
roles: Array<string>;
/** `token` */
accessToken: string;
/** 用于调用刷新`accessToken`的接口时所需的`token` */
refreshToken: string;
/** `accessToken`的过期时间(格式'xxxx/xx/xx xx:xx:xx' */
expires: Date;
};
};
/** 获取验证码 */
export const getVerify = () => {
return http.request<Result>("get", "/captcha");
export type RefreshTokenResult = {
success: boolean;
data: {
/** `token` */
accessToken: string;
/** 用于调用刷新`accessToken`的接口时所需的`token` */
refreshToken: string;
/** `accessToken`的过期时间(格式'xxxx/xx/xx xx:xx:xx' */
expires: Date;
};
};
/** 登录 */
export const getLogin = (data: object) => {
return http.request("post", "/login", { data });
export const getLogin = (data?: object) => {
return http.request<UserResult>("post", "/login", { data });
};
/** 刷新token */
export const refreshToken = (data: object) => {
return http.request("post", "/refreshToken", { data });
export const refreshTokenApi = (data?: object) => {
return http.request<RefreshTokenResult>("post", "/refreshToken", { data });
};
// export const searchVague = (data: object) => {
// return http.request("post", "/searchVague", { data });
// };