|
@@ -5,7 +5,8 @@ import HDrpManagement from './HDrpManagement.js'
|
|
|
import SDrpManagement from './SDrpManagement.js'
|
|
|
import ARDrpManagement from './ARDrpManagement.js'
|
|
|
import Customized from './DrpCustomized.js'
|
|
|
-
|
|
|
+import utils from '@/utils/utils.js'
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
|
|
|
|
|
|
const routes = [
|
|
@@ -26,7 +27,7 @@ const routes = [
|
|
|
meta: {
|
|
|
title: '数据看板',
|
|
|
name: 'dataDashboard',
|
|
|
- keepAlive:true
|
|
|
+ keepAlive:false
|
|
|
},
|
|
|
component: ()=>import(/* webpackChunkName: "about" */ '@/views/dataDashboard/index.vue'),
|
|
|
},
|
|
@@ -100,25 +101,22 @@ const router = createRouter({
|
|
|
routes
|
|
|
})
|
|
|
|
|
|
-router.beforeEach((to, from)=> {
|
|
|
+router.beforeEach((to, from,next)=> {
|
|
|
useAuthStore().appData(to.meta.name)
|
|
|
let app = useAuthStore().app
|
|
|
if (to.name !== '404' && to.name !== 'login') {
|
|
|
- if (app && app.isneedpay) {
|
|
|
- return { name: 'modulesPay' }
|
|
|
+ if (!utils.hasAuth(app)) {
|
|
|
+ message.error('未授权该应用,无法访问!')
|
|
|
+ } else {
|
|
|
+ if (app && app.isneedpay) {
|
|
|
+ return { name: 'modulesPay' }
|
|
|
+ }
|
|
|
+ next()
|
|
|
}
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
}
|
|
|
|
|
|
|
|
|
})
|
|
|
-// router.beforeEach((to, from, next) => {
|
|
|
-// let str = JSON.stringify(useAuthStore().system)
|
|
|
-// if(str.includes(to.meta.name) || !to.meta.name) {
|
|
|
-// next()
|
|
|
-// } else {
|
|
|
-// next({
|
|
|
-// path:'/404'
|
|
|
-// })
|
|
|
-// }
|
|
|
-// })
|
|
|
export default router
|