提交 d0876984 authored 作者: pengxiaohui's avatar pengxiaohui

fix: 进入用户研究页先判断用户是否选取了案例

上级 5b1b656d
......@@ -98,11 +98,21 @@ export default {
}
},
created() {
console.log(this.$store.state.case)
this.init()
this.status = this.$route.query.type || '0'
},
methods: {
init() {
if (!(this.$store.state.case && this.$store.state.case.id)) {
this.$alert('请先选择完成产品分析案例选择,再进行用户分析', {
confirmButtonText: '重新开始',
showClose: false,
callback: action => {
this.$route.push('/home')
}
})
} else {
Promise.all([this.fetchQuestions(), this.fetchGetReport()]).then(res => {
// 组装数据
const questions = res[0]
......@@ -116,6 +126,7 @@ export default {
}).catch(err => {
console.log(err)
})
}
},
handlePrev() {
this.current.index--
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论