Commit bf93f3b0 by 程默

fix index重复渲染

parent 5ae6f5b5
...@@ -82,24 +82,28 @@ export default { ...@@ -82,24 +82,28 @@ export default {
this.options = options; this.options = options;
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
this.withoutScene = true; let op=wx.getStorageSync("openid")
//获取openId if (op) {
wx.login({ this.params += '&open_id='+wx.getStorageSync("openid");
success: res => { this.withoutScene = true;
this.code = res.code; }else{
login.miniLogin({ code: this.code}).then(res1 => { //获取openId
console.log(res1,555555) wx.login({
if (res1.data.code == 200) { success: res => {
wx.setStorage({ this.code = res.code;
key: "openid", login.miniLogin({ code: this.code}).then(res1 => {
data: res1.data.data.openid if (res1.data.code == 200) {
}); wx.setStorage({
} key: "openid",
this.params += '&open_id='+wx.getStorageSync("openid"); data: res1.data.data.openid
console.log(this.code,77777,this.params) });
}) }
}, this.params += '&open_id='+wx.getStorageSync("openid");
}) this.withoutScene = true;
})
},
})
}
// 移除重复参数 // 移除重复参数
if (options.params) { if (options.params) {
let params=decodeURIComponent(options.params) let params=decodeURIComponent(options.params)
......
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