提交 87db0f30 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 550b363e
......@@ -101,12 +101,11 @@ export default class API {
const { status, data } = res.response
if (data) {
if (status === 403 && !/getinfo$/i.test(res.config.url)) {
// if (store.state.isWeapp) {
// wx.miniProgram.navigateTo({ url: '/pages/login/index' })
// } else {
// router.push('/login')
// }
router.push('/login')
if (store.state.isWeapp) {
wx.miniProgram.navigateTo({ url: '/pages/login/index' })
} else {
router.push('/login')
}
}
if (status === 402) {
if (store.state.isWeapp) {
......
......@@ -56,17 +56,11 @@ export default {
this.getList()
},
onClick(data) {
if (data.free) {
if (this.isWeapp) {
wx.miniProgram.navigateTo({
url: `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
})
} else {
window.alert('请在微信小程序中打开')
}
return
}
this.$router.push({ name: 'courseLearnItem', params: { id: data.id } })
const url = data.free
? `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
: `/pages/web/index?src=${window.location.origin}/course/learn/${data.id}`
wx.miniProgram.navigateTo({ url })
// this.$router.push({ name: 'courseLearnItem', params: { id: data.id } })
}
},
beforeMount() {
......
......@@ -51,7 +51,9 @@ export default {
this.getList()
},
onClick(data) {
this.$router.push({ name: 'courseTagItem', params: { id: data.id } })
const url = `/pages/web/index?src=${window.location.origin}/course/tag/${data.id}`
wx.miniProgram.navigateTo({ url })
// this.$router.push({ name: 'courseTagItem', params: { id: data.id } })
}
},
beforeMount() {
......
......@@ -64,17 +64,10 @@ export default {
this.getList()
},
onClick(data) {
if (this.isWeapp) {
let url = ''
if (data.free) {
url = `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
} else {
url = `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
}
wx.miniProgram.navigateTo({ url })
} else {
window.alert('请在微信小程序中打开')
}
const url = data.free
? `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
: `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
wx.miniProgram.navigateTo({ url })
}
},
beforeMount() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论