diff --git a/src/App.vue b/src/App.vue index 211ad15..9e1fb48 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,7 +48,7 @@ export default { } }, mounted() { - // this.init() + this.init() // this.$geo.getWebGeo().then(pos => { // this.geo = pos // }) @@ -69,7 +69,8 @@ export default { } }, init() { - this.$get('/v1/client/HWxinfoClient/share').then(res => { + // 持久请求,避免被路由切换时的 abortAll() 取消 + this.$get('/v1/client/HWxinfoClient/share', undefined, undefined, undefined, true).then(res => { this.wechatShareInfo = res.data || {} }) }, diff --git a/src/api/http.js b/src/api/http.js index de90c0f..a0134aa 100644 --- a/src/api/http.js +++ b/src/api/http.js @@ -124,7 +124,7 @@ function handleUnauthorized(requestToken) { */ function handleError(err, requestToken) { // token 失效 - if (err.status === ERR_CODE.UNAUTHORIZED || err.status === ERR_CODE.FORBIDDEN) { + if (err.status === ERR_CODE.UNAUTHORIZED) { handleUnauthorized(requestToken); } return Promise.reject(err); diff --git a/src/views/Goods/GoodsDetail.vue b/src/views/Goods/GoodsDetail.vue index 1666b0b..8ac557f 100644 --- a/src/views/Goods/GoodsDetail.vue +++ b/src/views/Goods/GoodsDetail.vue @@ -140,7 +140,7 @@