Commit baad3538 by 李嘉林

获取openid

parent ad9ecfd0
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
this.withoutScene = true; this.withoutScene = true;
}else{ }else{
//获取openId //获取openId
wx.login({ wx.login({
success: res => { success: res => {
this.code = res.code; this.code = res.code;
console.log(this.code,'-----------------------------110---code') console.log(this.code,'-----------------------------110---code')
...@@ -213,21 +213,29 @@ export default { ...@@ -213,21 +213,29 @@ 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 => {
indexApi.addRecord( if (res1.data.code == 200) {
{ wx.setStorage({
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId, key: "openid",
miniOpenId: wx.getStorageSync("openid"), data: res1.data.data
registerFlag: 1, });
newRegisterFlag: 0, indexApi.addRecord(
} {
).then(ele=>{ attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
//清空引客渠道id miniOpenId: res1.data.data,
wx.setStorageSync('attractingCustomerChannelId',''); registerFlag: 1,
}) newRegisterFlag: 0,
} }
).then(ele=>{
//清空引客渠道id
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