Commit abad24c9 authored by Facius's avatar Facius

improvement: 首页触发登录需要传登录后跳转路径的参数

parent 945ca962
...@@ -361,6 +361,9 @@ export default { ...@@ -361,6 +361,9 @@ export default {
}, },
handleSelect() { handleSelect() {
if (!this.checkToken()) {
return
}
var str = this.info.id ? 'selectedList' : 'selectCategory' var str = this.info.id ? 'selectedList' : 'selectCategory'
this.$u.route({ this.$u.route({
url: 'pages/learn/' + str, url: 'pages/learn/' + str,
...@@ -368,10 +371,7 @@ export default { ...@@ -368,10 +371,7 @@ export default {
}, },
// 每日一练 // 每日一练
handleAnswer() { handleAnswer() {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
if (this.info.cardId) { if (this.info.cardId) {
...@@ -414,10 +414,7 @@ export default { ...@@ -414,10 +414,7 @@ export default {
} }
}, },
handleClickLeftTop() { handleClickLeftTop() {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
this.$u.route({ this.$u.route({
...@@ -436,10 +433,7 @@ export default { ...@@ -436,10 +433,7 @@ export default {
}) })
}, },
handleClickItem(key) { handleClickItem(key) {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
if (this.info.id) { if (this.info.id) {
...@@ -472,10 +466,7 @@ export default { ...@@ -472,10 +466,7 @@ export default {
}) })
}, },
handleClickExam(index) { handleClickExam(index) {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
if (this.info.cardId) { if (this.info.cardId) {
...@@ -509,10 +500,7 @@ export default { ...@@ -509,10 +500,7 @@ export default {
} }
}, },
handleClick(path, params) { handleClick(path, params) {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
if (this.info.cardId) { if (this.info.cardId) {
...@@ -557,10 +545,7 @@ export default { ...@@ -557,10 +545,7 @@ export default {
this.finishCount = this.answerCount[this.questionWarehouseId] || 0 this.finishCount = this.answerCount[this.questionWarehouseId] || 0
}, },
handleSelectTip() { handleSelectTip() {
if (!this.vuex_token) { if (!this.checkToken()) {
this.$u.route({
url: 'pages/login/index',
})
return return
} }
this.$u.route({ this.$u.route({
...@@ -582,6 +567,19 @@ export default { ...@@ -582,6 +567,19 @@ export default {
}, 3000) }, 3000)
} }
}, },
checkToken() {
if (this.vuex_token) {
return true
} else {
this.$u.route({
url: 'pages/login/index',
params: {
path: 'pages/learn/selectCategory',
},
})
return false
}
},
}, },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment