Commit 17b44a31 by 潘琦

部分android手机白板问题;

parent 2cb97849
......@@ -60,7 +60,7 @@ const webpackConfig = merge(baseWebpackConfig, {
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
filename: utils.assetsPath('css/[name].[contenthash].css?v=' + timeStamp),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,10 +15,13 @@
},
"dependencies": {
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"es6-promise": "^4.2.8",
"mint-ui": "^2.2.13",
"nprogress": "^0.2.0",
"qrcodejs2": "0.0.2",
"vue": "^2.5.2",
"vue-cookies": "^1.5.13",
"vue-router": "^3.0.1",
"vue-signature": "^2.4.3",
"vuex": "^3.1.1",
......
<template>
<div id="app" class="full-height">
<keep-alive>
<div id="app" v-cloak class="full-height">
<!-- <keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
<router-view v-if="!$route.meta.keepAlive"></router-view> -->
<router-view></router-view>
</div>
</template>
......
......@@ -12,38 +12,52 @@ const defaultUrl = baseUrl.authUrl
router.beforeEach((to, from, next) => {
console.log('缓冲设置')
console.log('code ===' + store.getters.code)
// 判断链接是否被微信分享篡改,false需重定向
if (redirectUrl()) {
// store.dispatch('setToken', '')
// store.dispatch('setUserId', '')
// let accessToken = store.getters.access_token
let storecode = store.getters.code
if (!storecode || storecode === '') {
let params = getParamsByUrl(window.location.href)
if (params.code) {
store.dispatch('setCode', params.code)
getOauthFn(() => {
// wxpermission(0, () => {})
next()
})
} else {
getWXOauth()
}
} else {
// wxpermission(0, () => {})
getWXOauth(() => {
next()
})
}
} else {
if (globalNewUrl !== '') {
window.location.href = globalNewUrl
}
next()
}
// 判断链接是否被微信分享篡改,false需重定向
// if (redirectUrl()) {
// // store.dispatch('setToken', '')
// // store.dispatch('setUserId', '')
// // let accessToken = store.getters.access_token
// let storecode = store.getters.code
// if (!storecode || storecode === '') {
// let params = getParamsByUrl(window.location.href)
// if (params.code) {
// store.dispatch('setCode', params.code)
// getOauthFn(() => {
// // wxpermission(0, () => {})
// next()
// })
// } else {
// getWXOauth()
// }
// } else {
// // wxpermission(0, () => {})
// next()
// }
// } else {
// if (globalNewUrl !== '') {
// window.location.href = globalNewUrl
// }
// }
// store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77')
})
let getWXOauth = () => {
console.log()
let getWXOauth = (callback) => {
let url = removeUrlParam('code')
// store.dispatch('setCode', '')
let authId = ''
......@@ -52,6 +66,12 @@ let getWXOauth = () => {
store.dispatch('setAuthId', getParamsByUrl(window.location.href).auth_id)
}
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) => {
......@@ -67,7 +87,9 @@ let getOauthFn = (callback) => {
} else {
store.dispatch('setCode', '')
setTimeout(function () {
getWXOauth()
getWXOauth(() => {
callback()
})
}, 3 * 1000)
Toast({
message: '微信token已失效!',
......@@ -98,6 +120,12 @@ const getUserByTokenFn = (token, code, callback) => {
let accountId = res.accountid
if (accountId && accountId !== '') {
store.dispatch('setAccountId', accountId)
} else {
Toast({
message: 'account id不能为空!',
position: 'center',
duration: 3 * 1000
})
}
if (res.ext && res.ext !== '') {
let extOBJ = JSON.parse(res.ext)
......@@ -112,7 +140,9 @@ const getUserByTokenFn = (token, code, callback) => {
callback()
} else {
setTimeout(function () {
getWXOauth()
getWXOauth(() => {
callback()
})
}, 3 * 1000)
Toast({
message: 'user id不能为空!',
......@@ -122,7 +152,9 @@ const getUserByTokenFn = (token, code, callback) => {
}
} else {
setTimeout(function () {
getWXOauth()
getWXOauth(() => {
callback()
})
}, 3 * 1000)
Toast({
message: 'token不能为空!',
......@@ -138,47 +170,49 @@ const getUserByTokenFn = (token, code, callback) => {
duration: 3 * 1000
})
setTimeout(function () {
getWXOauth()
getWXOauth(() => {
callback()
})
}, 3 * 1000)
})
}
let globalNewUrl = ''
// let globalNewUrl = ''
// 判断链接是否被微信分享篡改
const redirectUrl = () => {
const curUrl = window.location.href
const curUrlArr = curUrl.split('?')
// Toast({
// message: curUrl,
// position: 'center',
// duration: 2 * 1000
// })
// console.log(curUrlArr[1].indexOf('from=singlemessage'))
if (curUrlArr.length === 3 && curUrlArr[1].indexOf('from=singlemessage') >= 0) {
let newUrl = curUrlArr[0] + '#' + curUrlArr[1].split('#')[1] + '?' + curUrlArr[2]
// Toast({
// message: curUrlArr[2],
// position: 'center',
// duration: 5 * 1000
// })
globalNewUrl = newUrl
// window.location.href = newUrl
return false
} else if (curUrl.indexOf('?scene=0') >= 0) {
let newUrl = curUrl.replace('?scene=0', '')
globalNewUrl = newUrl
return false
} else if (curUrl.indexOf('/voucher/?') >= 0) {
const urlArr = curUrl.split('/voucher/?')
const locationStr = urlArr[0]
const pathArr = urlArr[1].split('#')
let newUrl = locationStr + '/voucher/#' + pathArr[1]
globalNewUrl = newUrl
return false
} else {
return true
}
}
// const redirectUrl = () => {
// const curUrl = window.location.href
// const curUrlArr = curUrl.split('?')
// // Toast({
// // message: curUrl,
// // position: 'center',
// // duration: 2 * 1000
// // })
// // console.log(curUrlArr[1].indexOf('from=singlemessage'))
// if (curUrlArr.length === 3 && curUrlArr[1].indexOf('from=singlemessage') >= 0) {
// let newUrl = curUrlArr[0] + '#' + curUrlArr[1].split('#')[1] + '?' + curUrlArr[2]
// // Toast({
// // message: curUrlArr[2],
// // position: 'center',
// // duration: 5 * 1000
// // })
// globalNewUrl = newUrl
// // window.location.href = newUrl
// return false
// } else if (curUrl.indexOf('?scene=0') >= 0) {
// let newUrl = curUrl.replace('?scene=0', '')
// globalNewUrl = newUrl
// return false
// } else if (curUrl.indexOf('/voucher/?') >= 0) {
// const urlArr = curUrl.split('/voucher/?')
// const locationStr = urlArr[0]
// const pathArr = urlArr[1].split('#')
// let newUrl = locationStr + '/voucher/#' + pathArr[1]
// globalNewUrl = newUrl
// return false
// } else {
// return true
// }
// }
// const nextToPath = (to, from, next) => {
// let toquery = to.query
......
......@@ -707,14 +707,15 @@ export default {
})
},
getUserSignInfoFn () { // 获取用户签约信息
if (this.accountId === null || this.accountId === '') {
this.$toast({
message: '用户account id不能为空!',
position: 'center',
duration: 3000
})
return
} else if (this.pageType == null) {
// if (this.accountId === null || this.accountId === '') {
// this.$toast({
// message: '用户account id不能为空!',
// position: 'center',
// duration: 3000
// })
// return
// }
if (this.pageType == null) {
this.$toast({
message: '页面参数不完整!',
position: 'center',
......@@ -1103,6 +1104,20 @@ export default {
}
},
confirmSignature () {
if (!this.accountId && store.getters.accountId && store.getters.accountId !== '') {
this.accountId = store.getters.accountId
} else if (!this.accountId && (!store.getters.accountId || store.getters.accountId === '')) {
this.$toast({
message: 'account id不能为空',
position: 'center',
duration: 3 * 1000
})
}
// this.$toast({
// message: 'account id=' + this.accountId,
// position: 'center',
// duration: 3 * 1000
// })
if (parseInt(this.pageType) === 0) {
if (this.signState === '1' && this.isSign === 0) { // 已签约已审核通过 跳转至首页
this.$router.push({
......
......@@ -663,14 +663,15 @@ export default {
})
},
getUserSignInfoFn () { // 获取用户签约信息
if (this.accountId === null || this.accountId === '') {
this.$toast({
message: '用户account id不能为空!',
position: 'center',
duration: 3000
})
return
}
// if (this.accountId === null || this.accountId === '') {
// this.$Indicator.close()
// this.$toast({
// message: '用户account id不能为空!',
// position: 'center',
// duration: 3000
// })
// return
// }
let params = {
type: this.pageType,
accountId: this.accountId
......@@ -1024,6 +1025,20 @@ export default {
}
},
confirmSignature () {
if (!this.accountId && store.getters.accountId && store.getters.accountId !== '') {
this.accountId = store.getters.accountId
} else if (!this.accountId && (!store.getters.accountId || store.getters.accountId === '')) {
this.$toast({
message: 'account id不能为空',
position: 'center',
duration: 3 * 1000
})
}
// this.$toast({
// message: 'account id=' + this.accountId,
// position: 'center',
// duration: 3 * 1000
// })
if (parseInt(this.pageType) === 0) {
if (this.signState === '1') { // 已审核通过 跳转至首页
this.$router.push({
......
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