Commit c8f885be by 潘琦

去掉链接中#号,解决部分手机重定向鉴权白板问题;

parent 17b44a31
......@@ -15,15 +15,13 @@ router.beforeEach((to, from, next) => {
let storecode = store.getters.code
if (!storecode || storecode === '') {
let params = getParamsByUrl(window.location.href)
if (params.code) {
if (params.code && params.code !== 'undefined') {
store.dispatch('setCode', params.code)
getOauthFn(() => {
next()
})
} else {
getWXOauth(() => {
next()
})
getWXOauth()
}
} else {
next()
......@@ -57,7 +55,7 @@ router.beforeEach((to, from, next) => {
// store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77')
})
let getWXOauth = (callback) => {
let getWXOauth = () => {
let url = removeUrlParam('code')
// store.dispatch('setCode', '')
let authId = ''
......@@ -65,13 +63,8 @@ let getWXOauth = (callback) => {
authId = '&auth_id=' + getParamsByUrl(window.location.href).auth_id
store.dispatch('setAuthId', getParamsByUrl(window.location.href).auth_id)
}
// window.location.reload(defaultUrl + '/wxoauth/route?redirect_uri=' + encodeURIComponent(url) + authId + '&auth_scene=voucher&v=' + timeStamp)
window.location.href = defaultUrl + '/wxoauth/route?redirect_uri=' + encodeURIComponent(url) + authId + '&auth_scene=voucher'
const u = navigator.userAgent
const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 // g
// const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
if (isAndroid) {
callback()
}
}
let getOauthFn = (callback) => {
......
......@@ -4,6 +4,8 @@ import Router from 'vue-router'
Vue.use(Router)
export default new Router({
mode: 'history',
base: '/voucher/',
routes: [
{
path: '/',
......@@ -145,6 +147,5 @@ export default new Router({
}
]
}
],
base: '/voucher/'
]
})
......@@ -272,9 +272,17 @@ export default {
getTipsByVoucherId(this.voucherId).then(res => {
this.$Indicator.close()
if (res && res.msg === 'success') {
this.tipsPopupVisible = true
this.tipsData = res.data
this.tipsData.tipsDetailed = this.tipsData.tipsDetailed.replace(/[\r\n]/g, '<br>')
if (res.data) {
this.tipsPopupVisible = true
this.tipsData = res.data
this.tipsData.tipsDetailed = this.tipsData.tipsDetailed.replace(/[\r\n]/g, '<br>')
} else {
this.$toast({
message: '该服务券还没有小贴士噢!',
position: 'center',
duration: 3000
})
}
} else {
this.$toast({
message: '该服务券还没有小贴士噢!',
......
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