Commit baad3538 by 李嘉林

获取openid

parent ad9ecfd0
...@@ -213,13 +213,18 @@ export default { ...@@ -213,13 +213,18 @@ export default {
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId); wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId); wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
console.log(res.data.data) console.log(res.data.data)
console.log(wx.getStorageSync("openid")) wx.login({
console.log(333333) success: res => {
if(wx.getStorageSync("openid")) { login.get_open_id_by_code({ code: res.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorage({
key: "openid",
data: res1.data.data
});
indexApi.addRecord( indexApi.addRecord(
{ {
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId, attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: wx.getStorageSync("openid"), miniOpenId: res1.data.data,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: 0, newRegisterFlag: 0,
} }
...@@ -228,6 +233,9 @@ export default { ...@@ -228,6 +233,9 @@ export default {
wx.setStorageSync('attractingCustomerChannelId',''); wx.setStorageSync('attractingCustomerChannelId','');
}) })
} }
})
},
})
let params = ''; let params = '';
for(let i in paramsObj){ for(let i in paramsObj){
params += "&"+i+'='+paramsObj[i] params += "&"+i+'='+paramsObj[i]
......
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