Commit cff7e169 by 侯体倬

store 数据丢失后获取缓存

parent 0089c776
......@@ -47,6 +47,7 @@ export default {
this.extConfig = shopItem[process.env.NODE_ENV];
}
wx.setStorageSync("extConfig", JSON.stringify(this.extConfig));
wx.setStorageSync("mixid", this.extConfig.mixid);
console.log("extConfig->", this.extConfig);
......
......@@ -12,7 +12,7 @@ export async function requestGET(url, options) {
data: options,
method: "GET",
header: {
"Shop-Mixid": store.state.mixid,
"Shop-Mixid": store.state.mixid || wx.getStorageSync('mixid'),
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"Authorization": wx.getStorageSync('sessionid') || "",
"Region-id" : wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
......@@ -36,7 +36,7 @@ export async function requestPOST(url, options) {
data: options,
method: "POST",
header: {
"Shop-Mixid": store.state.mixid,
"Shop-Mixid": store.state.mixid || wx.getStorageSync('mixid'),
"Authorization": wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"openId": wx.getStorageSync("openid") || '',
......@@ -62,7 +62,7 @@ export function requestPOST1(url, options) {
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
"Shop-Mixid": store.state.mixid,
"Shop-Mixid": store.state.mixid || wx.getStorageSync('mixid'),
Authorization: wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"Region-id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
......
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