|
@@ -152,7 +152,7 @@ const router = new VueRouter({
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
const whiteList = '/login'
|
|
|
if (to.path !== whiteList && to.path !== '/Create' && to.path !== '/noadmin' && to.path !== '/forgotpassword') {
|
|
|
- if (userStore().user.role.indexOf("2") !== -1 || userStore().user.role.indexOf("1") !== -1) {
|
|
|
+ if (userStore().user.role?.indexOf("2") !== -1 || userStore().user.role?.indexOf("1") !== -1) {
|
|
|
next()
|
|
|
} else {
|
|
|
next('/noadmin')
|