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

bug fixes

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