|
...
|
...
|
@@ -125,12 +125,16 @@ App({ |
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
async _getLiteOpenidByCode(code){
|
|
|
|
async _getLiteOpenidByCode(code,app_unionid){
|
|
|
|
return new Promise((success,fail)=>{
|
|
|
|
let params={code:code}
|
|
|
|
if(app_unionid){
|
|
|
|
params.unionid=app_unionid
|
|
|
|
}
|
|
|
|
wx.request({
|
|
|
|
url: uri_dc.HOST__LINE+'App.Reserve.GetLiteOpenid',
|
|
|
|
method: 'POST',
|
|
|
|
data: {code:code},
|
|
|
|
data: params,
|
|
|
|
header: {
|
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
},
|
|
...
|
...
|
@@ -152,20 +156,20 @@ App({ |
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
async _getOpenid(){
|
|
|
|
async _getOpenid(app_unionid){
|
|
|
|
try{
|
|
|
|
let login_res=await this._login();
|
|
|
|
let openid=await this._getLiteOpenidByCode(login_res.code)
|
|
|
|
let openid=await this._getLiteOpenidByCode(login_res.code,app_unionid)
|
|
|
|
return openid
|
|
|
|
}catch(e){
|
|
|
|
console.log('_getOpenid.catch',e)
|
|
|
|
return this._getOpenid();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async getOpenid(){
|
|
|
|
async getOpenid(app_unionid=''){
|
|
|
|
let openid=wx.getStorageSync('customer_openid');
|
|
|
|
if(!openid){
|
|
|
|
openid= await this._getOpenid();
|
|
|
|
openid= await this._getOpenid(app_unionid);
|
|
|
|
}
|
|
|
|
this.openid=openid
|
|
|
|
return openid;
|
...
|
...
|
|