Commit 99291d7d by 李嘉林

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

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