提交 9621eae6 authored 作者: lihuihui's avatar lihuihui

updata

上级 65a2fbaa
...@@ -12,18 +12,18 @@ module.exports = { ...@@ -12,18 +12,18 @@ module.exports = {
}, },
devServer: { devServer: {
proxy: { proxy: {
'/api/passport': { // '/api/passport': {
target: 'https://passport.ezijing.com', // target: 'https://passport.ezijing.com',
pathRewrite: { // pathRewrite: {
'^/api/passport': '/' // 需要rewrite重写的 // '^/api/passport': '/' // 需要rewrite重写的
} // }
}, // },
'/usercenter': { // '/usercenter': {
target: 'https://api-usercenter.ezijing.com', // target: 'https://api-usercenter.ezijing.com',
pathRewrite: { // pathRewrite: {
'^/usercenter': '/' // 需要rewrite重写的 // '^/usercenter': '/' // 需要rewrite重写的
} // }
} // }
/* 多个代理 */ /* 多个代理 */
// '/api': { // '/api': {
// target: $GLOBAL.webConf.url, // target: $GLOBAL.webConf.url,
......
...@@ -94,7 +94,7 @@ export default class API { ...@@ -94,7 +94,7 @@ export default class API {
const { status, data } = res.response const { status, data } = res.response
if (data) { if (data) {
if (status === 402) { if (status === 402) {
window.G.$instance_vue.$router.push({ window.G.$instance_vue.$router.replace({
path: '/pay' path: '/pay'
}) })
} }
......
...@@ -174,20 +174,19 @@ export default { ...@@ -174,20 +174,19 @@ export default {
methods: { methods: {
async submitShowPop() { async submitShowPop() {
const isLogin = await this.$store.dispatch('checkLogin') const isLogin = await this.$store.dispatch('checkLogin')
console.log(isLogin)
if (!isLogin) { if (!isLogin) {
if (this.isWeapp) { if (this.isWeapp) {
// 小程序 // 小程序
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({
url: `/pages/login/index?redirect_uri=${encodeURIComponent( url: `/pages/login/index?redirect_uri=${encodeURIComponent(
`/pages/web/index?src=${window.location.origin}/course/learn` `/exam/result?type=${this.$route.query.type}&is_create=0&papersUrl=${this.$route.query.papersUrl}`
)}` )}`
}) })
} else { } else {
this.$router.push({ this.$router.push({
path: '/login', path: '/login',
query: { query: {
redirect_uri: `/exam/answer?type=${this.$route.query.type}&is_create=0&papersUrl=${this.$route.query.papersUrl}` redirect_uri: `/exam/result?type=${this.$route.query.type}&is_create=0&papersUrl=${this.$route.query.papersUrl}`
} }
}) })
} }
...@@ -376,7 +375,7 @@ export default { ...@@ -376,7 +375,7 @@ export default {
}, },
initData(n) { initData(n) {
const param = this.requestParam const param = this.requestParam
if (window.localStorage.userId) { if (window.localStorage.userId !== 'undefined') {
param.user_id = window.localStorage.userId param.user_id = window.localStorage.userId
} }
Exam.getExam(param, this.requestParam.papersUrl).then(res => { Exam.getExam(param, this.requestParam.papersUrl).then(res => {
......
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getCourseChapterList() // this.getCourseChapterList()
this.scrollDom() this.scrollDom()
this.init() this.init()
}, },
...@@ -128,7 +128,6 @@ export default { ...@@ -128,7 +128,6 @@ export default {
if (isLogin) { if (isLogin) {
api.getExamStatus(param).then(res => { api.getExamStatus(param).then(res => {
if (res.status === '0' || res.status === '3') { if (res.status === '0' || res.status === '3') {
console.log(11111)
this.isExamPopTo = true this.isExamPopTo = true
} }
}) })
...@@ -193,18 +192,21 @@ export default { ...@@ -193,18 +192,21 @@ export default {
async tab(e) { async tab(e) {
const isLogin = await this.$store.dispatch('checkLogin') const isLogin = await this.$store.dispatch('checkLogin')
console.log(isLogin) console.log(isLogin)
if (!isLogin) { if (e === 1 || e === 2) {
if (this.isWeapp) { this.getCourseChapterList()
// 小程序 if (!isLogin) {
wx.miniProgram.navigateTo({ if (this.isWeapp) {
url: `/pages/login/index?redirect_uri=${encodeURIComponent( // 小程序
`/pages/web/index?src=${window.location.origin}/course/learn` wx.miniProgram.navigateTo({
)}` url: `/pages/login/index?redirect_uri=${encodeURIComponent(
}) `/pages/web/index?src=${window.location.origin}/course/learn`
} else { )}`
this.$router.push({ name: 'login' }) })
} else {
this.$router.push({ name: 'login' })
}
return
} }
return
} }
this.tabNav.navIndex = e this.tabNav.navIndex = e
this.scrollDom() this.scrollDom()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论