Commit abad24c9 authored by Facius's avatar Facius

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

parent 945ca962
......@@ -361,6 +361,9 @@ export default {
},
handleSelect() {
if (!this.checkToken()) {
return
}
var str = this.info.id ? 'selectedList' : 'selectCategory'
this.$u.route({
url: 'pages/learn/' + str,
......@@ -368,10 +371,7 @@ export default {
},
// 每日一练
handleAnswer() {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
if (this.info.cardId) {
......@@ -414,10 +414,7 @@ export default {
}
},
handleClickLeftTop() {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
this.$u.route({
......@@ -436,10 +433,7 @@ export default {
})
},
handleClickItem(key) {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
if (this.info.id) {
......@@ -472,10 +466,7 @@ export default {
})
},
handleClickExam(index) {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
if (this.info.cardId) {
......@@ -509,10 +500,7 @@ export default {
}
},
handleClick(path, params) {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
if (this.info.cardId) {
......@@ -557,10 +545,7 @@ export default {
this.finishCount = this.answerCount[this.questionWarehouseId] || 0
},
handleSelectTip() {
if (!this.vuex_token) {
this.$u.route({
url: 'pages/login/index',
})
if (!this.checkToken()) {
return
}
this.$u.route({
......@@ -582,6 +567,19 @@ export default {
}, 3000)
}
},
checkToken() {
if (this.vuex_token) {
return true
} else {
this.$u.route({
url: 'pages/login/index',
params: {
path: 'pages/learn/selectCategory',
},
})
return false
}
},
},
}
</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