|
@@ -4,6 +4,7 @@ import NProgress from 'nprogress' // progress bar
|
|
|
import 'nprogress/nprogress.css' // progress bar style
|
|
|
// import { getToken } from '@/utils/auth' // get token from cookie
|
|
|
import Cookies from 'js-cookie'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
|
|
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
|
|
|
|
@@ -17,7 +18,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
|
|
|
// determine whether the user has logged in
|
|
|
// const hasToken = getToken()
|
|
|
- const hasToken = store.getters.id
|
|
|
+ const hasToken = store.getters.id || getToken()
|
|
|
const isWeChat = Cookies.get('isWeChat')
|
|
|
if (to.query.courseid !== '' && to.query.courseid !== undefined) {
|
|
|
console.log(to.query.courseid)
|