v3.7.0
This commit is contained in:
parent
56106b8203
commit
c94a94d9d8
12
ZR.Vue/.jsbeautifyrc
Normal file
12
ZR.Vue/.jsbeautifyrc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"brace_style": "none,preserve-inline",
|
||||||
|
"indent_size": 2,
|
||||||
|
"indent_char": " ",
|
||||||
|
"jslint_happy": true,
|
||||||
|
"unformatted": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"css": {
|
||||||
|
"indent_size": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,9 @@
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import {
|
import { Message } from 'element-ui'
|
||||||
Message
|
|
||||||
} from 'element-ui'
|
|
||||||
import NProgress from 'nprogress'
|
import NProgress from 'nprogress'
|
||||||
import 'nprogress/nprogress.css'
|
import 'nprogress/nprogress.css'
|
||||||
import {
|
import { getToken } from '@/utils/auth'
|
||||||
getToken
|
|
||||||
} from '@/utils/auth'
|
|
||||||
|
|
||||||
NProgress.configure({
|
NProgress.configure({
|
||||||
showSpinner: false
|
showSpinner: false
|
||||||
@ -22,9 +18,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({
|
next({ path: '/' })
|
||||||
path: '/'
|
|
||||||
})
|
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.roles.length === 0) {
|
if (store.getters.roles.length === 0) {
|
||||||
@ -38,7 +32,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
console.log('弹框登录失败')
|
console.log('弹框登录失败')
|
||||||
Message.error(err != undefined ? err : '登录失败')
|
Message.error(err != undefined ? err : '登录失败')
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
})
|
})
|
||||||
@ -62,4 +56,4 @@ router.beforeEach((to, from, next) => {
|
|||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user