部分安卓用户访问的时候空白。有谁遇到过,给我点提示啊?
- 项目用的是 `@vue/cli 4.2.3`打包的
- 在线地址:http://h5.chicken.yunqian.info/
其次问下安卓访问公众号网页的缓存怎么清除?页面删了几小时都还能访问那种。
# package.json
{
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.4",
"less": "^3.11.1",
"less-loader": "^5.0.0",
"store2": "^2.11.0",
"vant": "^2.4.7",
"vue": "^2.6.11",
"vue-router": "^3.1.5",
"vue-wechat-title": "^2.0.5",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-service": "~4.2.0",
"babel-eslint": "^10.0.3",
"babel-plugin-import": "^1.13.0",
"eslint": "^6.7.2",
"vconsole": "^3.3.4",
"eslint-plugin-vue": "^6.1.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 5 versions"
]
}
# main.js
# 导航守卫
router.beforeEach((to, from, next) => {
const { token } = to.query
const { token: id } = store.state.user
if (token) {
fetchUserInfo(token).then(res => {
store.commit('setUser', res)
next()
})
} else if (!id) {
const {
query: { params },
fullPath
} = to
window.sessionStorage.setItem('fullPath', fullPath)
const query = params ? `?params=${encodeURI(params)}` : ''
const url = `https://api.domain.info/wechat/authorize${query}`
window.location.replace(url)
/*const debug = process.env.NODE_ENV === 'development'
if (debug) {
throw new Error('获取用户信息失败')
} else {
window.location.replace(url)
}*/
} else {
next()
}
})