mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 02:55:07 +08:00
feature(使用redis缓存): 功能合并
1、缓存改为Redis缓存,不在启动时缓存,使用时候根据数据源缓存 2、前端登录接口调整
This commit is contained in:
@ -25,9 +25,10 @@ router.beforeEach((to, from, next) => {
|
||||
// 获取字典数据 add by 芋艿
|
||||
store.dispatch('dict/loadDictDatas')
|
||||
// 判断当前用户是否已拉取完 user_info 信息
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
store.dispatch('GetInfo').then(userInfo => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
// 触发 GenerateRoutes 事件时,将 menus 菜单树传递进去
|
||||
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||
// 根据 roles 权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
|
Reference in New Issue
Block a user