Commit 99291d7d by 李嘉林

小程序添加线下门店请求头

parent e0fec4dc
...@@ -95,6 +95,8 @@ export default { ...@@ -95,6 +95,8 @@ export default {
} }
}); });
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
console.log(params.offlineShopCode,'-----------------98');
this.$store.commit("setOfflineShopCode", params.offlineShopCode);
this.liveId = params.liveId; this.liveId = params.liveId;
this.shopName = params.shopName; this.shopName = params.shopName;
this.shopLogo = DFSImg(params.shopLogo, 40, 40); this.shopLogo = DFSImg(params.shopLogo, 40, 40);
......
...@@ -6,6 +6,10 @@ const mutations = { ...@@ -6,6 +6,10 @@ const mutations = {
}, },
setSubscribeMessageObj(state, subscribeMessageObj) { setSubscribeMessageObj(state, subscribeMessageObj) {
state.subscribeMessageObj = subscribeMessageObj; state.subscribeMessageObj = subscribeMessageObj;
} },
setOfflineShopCode(state, code) {
state.offlineShopCode = code;
},
}; };
export default mutations export default mutations
\ No newline at end of file
...@@ -2,6 +2,7 @@ const state = { ...@@ -2,6 +2,7 @@ const state = {
spokesmanGroupId: "", spokesmanGroupId: "",
spokesmanShopId: "", spokesmanShopId: "",
spokesmanRelId: "", spokesmanRelId: "",
subscribeMessageObj: {} subscribeMessageObj: {},
offlineShopCode:"",
}; };
export default state export default state
\ No newline at end of file
let shopMixid =process.env.SHOP_MIXID; import store from '../store/index'
let shopMixid = process.env.SHOP_MIXID;
// wx.getStore // wx.getStore
export async function requestGET(url, options) { export async function requestGET(url, options) {
...@@ -8,7 +9,8 @@ export async function requestGET(url, options) { ...@@ -8,7 +9,8 @@ export async function requestGET(url, options) {
data: options, data: options,
method: "GET", method: "GET",
header: { header: {
"Shop-Mixid": shopMixid "Shop-Mixid": shopMixid,
"Offline-Shop-Code": store.state.offlineShopCode
}, },
success: function (res) { success: function (res) {
resolve(res) resolve(res)
...@@ -28,7 +30,8 @@ export async function requestPOST(url, options) { ...@@ -28,7 +30,8 @@ export async function requestPOST(url, options) {
method: "POST", method: "POST",
header: { header: {
"Shop-Mixid": shopMixid, "Shop-Mixid": shopMixid,
"Authorization": wx.getStorageSync('sessionid') || "" "Authorization": wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": store.state.offlineShopCode
}, },
success: function (res) { success: function (res) {
resolve(res) resolve(res)
...@@ -49,7 +52,8 @@ export function requestPOST1(url, options) { ...@@ -49,7 +52,8 @@ export function requestPOST1(url, options) {
header: { header: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
"Shop-Mixid": shopMixid, "Shop-Mixid": shopMixid,
Authorization: wx.getStorageSync('sessionid') || "" Authorization: wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": store.state.offlineShopCode
}, },
success: function (res) { success: function (res) {
resolve(res) resolve(res)
......
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