Commit 7ef25b93cc765cd06efb36b260a9cf864f456eb8

Authored by vking
1 parent 5cc5537b

customer_session_key

Showing 1 changed file with 5 additions and 2 deletions
@@ -38,7 +38,7 @@ App({ @@ -38,7 +38,7 @@ App({
38 console.log('this.openid',this.openid,mta); 38 console.log('this.openid',this.openid,mta);
39 }, 39 },
40 onShow:async function(){ 40 onShow:async function(){
41 - this._getOpenid(); 41 + //this._getOpenid();
42 if (wx.canIUse('getUpdateManager')) { 42 if (wx.canIUse('getUpdateManager')) {
43 const updateManager = wx.getUpdateManager(); 43 const updateManager = wx.getUpdateManager();
44 updateManager.onCheckForUpdate(function (res) { 44 updateManager.onCheckForUpdate(function (res) {
@@ -105,6 +105,7 @@ App({ @@ -105,6 +105,7 @@ App({
105 return new Promise((success,fail)=>{ 105 return new Promise((success,fail)=>{
106 wx.login({ 106 wx.login({
107 success: (login_res)=>{ 107 success: (login_res)=>{
  108 + console.log('wx.login',login_res)
108 success(login_res); 109 success(login_res);
109 }, 110 },
110 fail:(res)=>{ 111 fail:(res)=>{
@@ -126,6 +127,7 @@ App({ @@ -126,6 +127,7 @@ App({
126 try{ 127 try{
127 let openid=res.data.data.openid; 128 let openid=res.data.data.openid;
128 wx.setStorage({key:'customer_openid',data:openid}); 129 wx.setStorage({key:'customer_openid',data:openid});
  130 + wx.setStorage({key:'customer_session_key',data:res.data.data.session_key});
129 success(openid); 131 success(openid);
130 }catch(e){ 132 }catch(e){
131 console.log(res); 133 console.log(res);
@@ -143,8 +145,9 @@ App({ @@ -143,8 +145,9 @@ App({
143 try{ 145 try{
144 let login_res=await this._login(); 146 let login_res=await this._login();
145 let openid=await this._getLiteOpenidByCode(login_res.code) 147 let openid=await this._getLiteOpenidByCode(login_res.code)
146 - return openid; 148 + return openid
147 }catch(e){ 149 }catch(e){
  150 + console.log('_getOpenid.catch',e)
148 return this._getOpenid(); 151 return this._getOpenid();
149 } 152 }
150 }, 153 },