|
@@ -19,7 +19,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
const hasToken = getToken()
|
|
const hasToken = getToken()
|
|
|
|
|
|
|
|
if (to.query.courseid) {
|
|
if (to.query.courseid) {
|
|
|
- await store.commit('app/SET_COURSEID', to.query.courseid)
|
|
|
|
|
|
|
+ await store.commit('SET_COURSEID', to.query.courseid)
|
|
|
}
|
|
}
|
|
|
if (hasToken) {
|
|
if (hasToken) {
|
|
|
if (to.path === '/login') {
|
|
if (to.path === '/login') {
|
|
@@ -34,7 +34,7 @@ router.beforeEach(async(to, from, next) => {
|
|
|
if (userinfo) {
|
|
if (userinfo) {
|
|
|
const courseId = store.getters.courseId
|
|
const courseId = store.getters.courseId
|
|
|
|
|
|
|
|
- next({ ...to, query: { courseid: courseId }})
|
|
|
|
|
|
|
+ next({ ...to, query: { courseid: courseId } })
|
|
|
} else {
|
|
} else {
|
|
|
try {
|
|
try {
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|