refactor:基于 lint 处理排版(框架层面)

This commit is contained in:
YunaiV
2025-04-22 22:17:41 +08:00
parent fb785894b6
commit c0a92a5694
10 changed files with 59 additions and 39 deletions

View File

@@ -61,7 +61,7 @@ class RequestClient {
responseReturn: 'raw',
// 默认超时时间
timeout: 10_000,
paramsSerializer: 'repeat'
paramsSerializer: 'repeat',
};
const { ...axiosConfig } = options;
const requestConfig = merge(axiosConfig, defaultConfig);

View File

@@ -88,7 +88,7 @@ export const useAccessStore = defineStore('core-access', {
},
setTenantId(tenantId: null | number) {
this.tenantId = tenantId;
}
},
},
persist: {
// 持久化
@@ -102,7 +102,7 @@ export const useAccessStore = defineStore('core-access', {
isAccessChecked: false,
loginExpired: false,
refreshToken: null,
tenantId: null
tenantId: null,
}),
});

View File

@@ -6,6 +6,10 @@ interface BasicUserInfo {
* 头像
*/
avatar: string;
/**
* 用户邮箱
*/
email?: string;
/**
* 用户昵称
*/
@@ -18,10 +22,6 @@ interface BasicUserInfo {
* 用户名
*/
username: string;
/**
* 用户邮箱
*/
email?: string;
}
interface AccessState {
@@ -50,7 +50,7 @@ export const useUserStore = defineStore('core-user', {
state: (): AccessState => ({
userInfo: null,
userRoles: [],
})
}),
});
// 解决热更新问题

View File

@@ -2,22 +2,18 @@ import type { AppRouteRecordRaw, BasicUserInfo } from '@vben-core/typings';
/** 用户信息 */
interface UserInfo extends BasicUserInfo {
/**
* 首页地址
*/
homePath: string;
}
/** 权限信息 */
interface AuthPermissionInfo {
user: UserInfo;
roles: string[];
permissions: string[];
menus: AppRouteRecordRaw[];
}
export type { UserInfo, AuthPermissionInfo };
export type { AuthPermissionInfo, UserInfo };

View File

@@ -1,8 +1,13 @@
import type { Router, RouteRecordRaw } from 'vue-router';
import type { ExRouteRecordRaw, MenuRecordRaw, RouteRecordStringComponent, AppRouteRecordRaw } from '@vben-core/typings';
import type {
AppRouteRecordRaw,
ExRouteRecordRaw,
MenuRecordRaw,
RouteRecordStringComponent,
} from '@vben-core/typings';
import { filterTree, mapTree, isHttpUrl } from '@vben-core/shared/utils';
import { filterTree, isHttpUrl, mapTree } from '@vben-core/shared/utils';
/**
* 根据 routes 生成菜单列表
@@ -142,7 +147,10 @@ function convertServerMenuToRouteRecordStringComponent(
};
if (menu.children && menu.children.length > 0) {
buildMenu.children = convertServerMenuToRouteRecordStringComponent(menu.children, menu.path);
buildMenu.children = convertServerMenuToRouteRecordStringComponent(
menu.children,
menu.path,
);
}
menus.push(buildMenu);
@@ -150,4 +158,4 @@ function convertServerMenuToRouteRecordStringComponent(
return menus;
}
export { generateMenus, convertServerMenuToRouteRecordStringComponent };
export { convertServerMenuToRouteRecordStringComponent, generateMenus };