docs: 修改系统注释

This commit is contained in:
WANGFAN\wangf 2025-04-10 23:05:48 +08:00
parent 2fbe311b60
commit 2e90b3836f
6 changed files with 34 additions and 34 deletions

2
.env
View File

@ -7,5 +7,5 @@ VITE_GLOB_APP_TITLE = SnowAdmin
# 静态资源url
VITE_IMG_BASE_URL = 'https://my-image-cdn.com'
# 本地mock数据
# 本地mock数据 true开启 false关闭
VITE_APP_OPEN_MOCK = true

View File

@ -22,17 +22,17 @@
*
* meta对象参数meta对象中
* meta: {
* title: 菜单栏以及 tabsView
* title: 国际化key
* hide: 是否隐藏此路由访
* disable: 是否停用访
* keepAlive: 是否缓存组件状态
* affix: 是否固定在 tabsView
* link: 是否是超链接菜单1 link 2iframe: false
* iframe: 是否内嵌窗口1iframetrue 2link
* roles: 当前路由权限表示 admincommon
* icon: 菜单tabsView
* svgIcon: svg图标
* sort: 菜单顺序
* disable: 是否停用此路由-访
* keepAlive: 是否缓存组件
* affix: 固定在Tabs栏上-Tabs栏无关闭按钮
* link: 是否是超链接菜单1 link 2iframe: false
* iframe: 是否内嵌外链窗口1iframetrue 2link
* roles: 路由权限标识admincommon
* svgIcon: svg菜单图标iconsrc/assets/svgs内的svg文件
* icon: 普通icon菜单图标arco.design图标
* sort: 排序字段
* type: 1 2 3
* }
*/
@ -40,30 +40,31 @@
/**
*
* layout为框架布局
* layout.children下的路由为menu菜单
* layout.children下的路由为systemMenu菜单
*/
export const systemMenu = [
// layout-二级路由(主要渲染页面)
{
id: "01",
parentId: "0",
path: "/home",
name: "home",
component: "home/home",
id: "01", // 路由id
parentId: "0", // 顶层路由 parentId: 0
path: "/home", // 路由path
name: "home", // 路由name
component: "home/home", // 路由跳转的文件路径默认在src/views内这里就是src/views/home/home.vue
meta: {
title: "home", // 国际化
hide: false, // 是否隐藏此路由
disable: false, // 是否停用此路由
keepAlive: false, // 缓存组件状态
affix: true, // 固定在tagesView栏上
title: "home", // 国际化key
hide: false, // 是否隐藏此路由-不显示但可访问
disable: false, // 是否停用此路由-不显示且不可访问
keepAlive: false, // 是否缓存组件
affix: true, // 固定在Tabs栏上-开启后Tabs栏无关闭按钮
link: "", // 是否外链
iframe: false, // 是否内嵌窗口
roles: ["admin", "common"], // 路由权限
svgIcon: "home", // 菜单图标
sort: 1,
iframe: false, // 是否内嵌外链窗口
roles: ["admin", "common"], // 路由角色权限
svgIcon: "home", // svg菜单图标优先级高于icon取src/assets/svgs内的svg文件
icon: "", // 普通icon菜单图标默认取arco.design图标
sort: 1, // 排序字段
type: 2 // type 1目录 2菜单 3按钮
},
children: null
children: null // 存储子节点字段默认为null
},
{
id: "02",

View File

@ -8,8 +8,8 @@ import { systemMenu, permissionData } from "../_data/system_menu";
* 1token判断角色
* 2
* 3
* 3
* 4
* 4
* 5
*
*
* 1

View File

@ -33,7 +33,7 @@ export default [
timeout: 300,
response: ({ headers }: any) => {
let data: any = {
user: {}, // 户信息
user: {}, // 户信息
roles: [], // 角色
permissions: [] // 权限
};

View File

@ -31,7 +31,7 @@ const router = createRouter({
* 1token
* 2token
* 3tokenhome页
* 4token
* 4token
*
* routeTree不能持久化缓存
* addRoute动态添加的路由失效
@ -54,7 +54,7 @@ router.beforeEach(async (to: any, _: any, next: any) => {
// 项目内的跳转,处理跳转路由高亮
currentlyRoute(to.name as string);
} else {
// 4、去非登录页有token校验是否动态添加过路由,添加过则放行,未添加则执行路由初始化
// 4、去非登录页有token用户信息是否存在,有则放行,否则重新获取路由信息、初始化路由
const routeStore = useRoutesConfigStore(pinia);
// 判断账号信息是否获取,先获取账号信息和路由信息,添加路由后再跳转(页面刷新时触发)

View File

@ -88,13 +88,12 @@ export const routesConfigStore = () => {
}
/**
*
* 1
* 1
* 2
* 3
* 4
* 5
* 6
* 7
*/
async function initSetRouter() {
// 1、获取过滤角色权限后的树后端做排序处理