7c233183 by renchao@pashanhoo.com

feat:权限

1 parent a5a1fa20
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-24 17:28:37
* @LastEditTime: 2023-03-27 14:20:03
*/
import Vue from 'vue'
import router from "./router";
......@@ -24,6 +24,7 @@ router.beforeEach(async (to, from, next) => {
localStorage.removeItem("token");
next();
} else {
window.document.documentElement.setAttribute("data-theme", 'blue');
let code = Vue.prototype.BASE_API.CODE
//判断token是否存在
const hasToken = localStorage.getItem("token");
......@@ -35,6 +36,7 @@ router.beforeEach(async (to, from, next) => {
if (hasAddRoute) {
next();
} else {
//请求菜单
const { result: getMenuData } = (await getMenuInfo(code)) || [];
const accessRoutes = await store.dispatch(
......@@ -54,7 +56,7 @@ router.beforeEach(async (to, from, next) => {
} else {
next();
}
window.document.documentElement.setAttribute("data-theme", 'blue');
}
} else {
if (code == 'BDCSBPT') {
......