Commit c4a374118aded3383f3ff0ad8f61b28bdbf4160c

Authored by vking
1 parent 6ec642e5

fix openid

@@ -45,8 +45,8 @@ App({ @@ -45,8 +45,8 @@ App({
45 this.shareTicket=opt.shareTicket; 45 this.shareTicket=opt.shareTicket;
46 } 46 }
47 this.getSystemInfo(); 47 this.getSystemInfo();
48 - this.openid=await this.getOpenid();  
49 - console.log('this.openid',this.openid,mta); 48 + //this.openid=await this.getOpenid();
  49 + //console.log('this.openid',this.openid,mta);
50 }, 50 },
51 onShow:async function(){ 51 onShow:async function(){
52 //this._getOpenid(); 52 //this._getOpenid();
@@ -209,7 +209,7 @@ Page({ @@ -209,7 +209,7 @@ Page({
209 209
210 }, 210 },
211 async getOpenid(){ 211 async getOpenid(){
212 - let openid = getApp().openid; 212 + let openid = await getApp().getOpenid();
213 return openid; 213 return openid;
214 }, 214 },
215 async SellerForOpenid(openid){ 215 async SellerForOpenid(openid){
@@ -119,7 +119,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr @@ -119,7 +119,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
119 return fail({msgSecCheck:true}) 119 return fail({msgSecCheck:true})
120 } 120 }
121 } 121 }
122 - let openid = wx.getStorageSync('customer_openid'); 122 + let openid = await getApp().getOpenid();
123 let formids = wx.getStorageSync('formids'); 123 let formids = wx.getStorageSync('formids');
124 if (formids) { 124 if (formids) {
125 wx.removeStorage({key: 'formids'}); 125 wx.removeStorage({key: 'formids'});
@@ -136,6 +136,9 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr @@ -136,6 +136,9 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
136 if (api.openid) { 136 if (api.openid) {
137 data[api.openid] = data[api.openid] || openid; 137 data[api.openid] = data[api.openid] || openid;
138 } 138 }
  139 + if(data['openid']==''){
  140 + data['openid']= openid;
  141 + }
139 let stime = new Date(); 142 let stime = new Date();
140 wx.request({ 143 wx.request({
141 url: host + act+'&'+getSignQuery(), 144 url: host + act+'&'+getSignQuery(),