将按钮的缓存从登录逻辑挪到登录之后的界面(优化)

This commit is contained in:
季圣华
2023-11-20 00:00:02 +08:00
parent 3955997974
commit 081f582f7f
3 changed files with 17 additions and 9 deletions

View File

@@ -3,7 +3,6 @@ import router from './router'
import store from './store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import notification from 'ant-design-vue/es/notification'
import { USER_ID,INDEX_MAIN_PAGE_PATH } from '@/store/mutation-types'
import { generateIndexRouter } from "@/utils/util"
@@ -25,6 +24,10 @@ router.beforeEach((to, from, next) => {
if (menuData === null || menuData === "" || menuData === undefined) {
return;
}
// 缓存用户的按钮权限
store.dispatch('GetUserBtnList').then(res => {
Vue.ls.set('winBtnStrList', res.data.userBtn, 7 * 24 * 60 * 60 * 1000)
})
let constRoutes = [];
constRoutes = generateIndexRouter(menuData);
// 添加主界面路由