diff --git a/buyer/src/App.vue b/buyer/src/App.vue index d88adcfb..ea59df2a 100644 --- a/buyer/src/App.vue +++ b/buyer/src/App.vue @@ -46,10 +46,14 @@ export default { getSite() { getBaseSite().then((res) => { if (res.success && res.result.settingValue) { - const data = JSON.parse(res.result.settingValue); - this.applySiteInfo(data); + try { + const data = JSON.parse(res.result.settingValue); + this.applySiteInfo(data); + } catch { + // 站点配置解析失败时使用缓存 + } } - }); + }).catch(() => {}); }, }, }; diff --git a/buyer/src/api/account.js b/buyer/src/api/account.js index ca80a7f6..b7b133b1 100644 --- a/buyer/src/api/account.js +++ b/buyer/src/api/account.js @@ -44,7 +44,8 @@ export function editMemberInfo (params) { url: '/buyer/passport/member/editOwn', method: Method.PUT, needToken: true, - data: params + data: params, + loading: false }) } diff --git a/buyer/src/api/address.js b/buyer/src/api/address.js index 6de478f4..a522bc32 100644 --- a/buyer/src/api/address.js +++ b/buyer/src/api/address.js @@ -17,7 +17,8 @@ export function newMemberAddress (params) { url: '/buyer/member/address', needToken: true, method: Method.POST, - data: params + data: params, + loading: false }); } @@ -27,7 +28,8 @@ export function editMemberAddress (params) { url: '/buyer/member/address', needToken: true, method: Method.PUT, - params + params, + loading: false }); } @@ -36,7 +38,8 @@ export function delMemberAddress (id) { return request({ url: `/buyer/member/address/delById/${id}`, needToken: true, - method: Method.DELETE + method: Method.DELETE, + loading: false }); } diff --git a/buyer/src/api/cart.js b/buyer/src/api/cart.js index e2ab9f50..4e77ab1a 100644 --- a/buyer/src/api/cart.js +++ b/buyer/src/api/cart.js @@ -20,7 +20,8 @@ export function cartGoodsAll () { return request({ url: '/buyer/trade/carts/all', method: Method.GET, - needToken: true + needToken: true, + loading: false }); } diff --git a/buyer/src/api/common.js b/buyer/src/api/common.js index 8c579162..b3e5e630 100644 --- a/buyer/src/api/common.js +++ b/buyer/src/api/common.js @@ -38,7 +38,8 @@ export function getRegion (id) { return request({ url: `${commonUrl}/common/common/region/item/${id}`, needToken: true, - method: Method.GET + method: Method.GET, + loading: false }); } diff --git a/buyer/src/api/goods.js b/buyer/src/api/goods.js index d38d97e4..89dbd28f 100644 --- a/buyer/src/api/goods.js +++ b/buyer/src/api/goods.js @@ -8,6 +8,7 @@ export function goodsList (params) { url: '/buyer/goods/goods/es', method: Method.GET, needToken: false, + optionalToken: true, params }); } @@ -18,6 +19,7 @@ export function filterList (params) { url: '/buyer/goods/goods/es/related', method: Method.GET, needToken: false, + optionalToken: true, params }); } diff --git a/buyer/src/api/member.js b/buyer/src/api/member.js index 7cce873e..0106de9d 100644 --- a/buyer/src/api/member.js +++ b/buyer/src/api/member.js @@ -298,7 +298,8 @@ export function cancelAfterSale (afterSaleSn) { return request({ url: `/buyer/order/afterSale/cancel/${afterSaleSn}`, method: Method.POST, - needToken: true + needToken: true, + loading: false }); } diff --git a/buyer/src/components/Search.vue b/buyer/src/components/Search.vue index da62267f..f5b47e1e 100644 --- a/buyer/src/components/Search.vue +++ b/buyer/src/components/Search.vue @@ -128,10 +128,14 @@ export default { }, computed: { promotionTags() { - if (this.$store.state.hotWordsList) { - return JSON.parse(this.$store.state.hotWordsList) - } else { - return [] + const raw = this.$store.state.hotWordsList; + if (!raw) { + return []; + } + try { + return typeof raw === "string" ? JSON.parse(raw) : raw; + } catch { + return []; } } }, @@ -145,12 +149,12 @@ export default { if (!reloadTime) { hotWords({count: 5}).then(res => { if (res.success && res.result) storage.setItem('hotWordsList', res.result) - }) + }).catch(() => {}) storage.setItem('hotWordsReloadTime', new Date().getTime()) } else if (reloadTime && time > reloadTime) { hotWords({count: 5}).then(res => { if (res.success && res.result) storage.setItem('hotWordsList', res.result) - }) + }).catch(() => {}) storage.setItem('hotWordsReloadTime', new Date().getTime()) } } diff --git a/buyer/src/components/advertising/FixedTop.vue b/buyer/src/components/advertising/FixedTop.vue index 1d080c03..7eed5e7a 100644 --- a/buyer/src/components/advertising/FixedTop.vue +++ b/buyer/src/components/advertising/FixedTop.vue @@ -1,6 +1,6 @@