|
|
@@ -25,6 +25,7 @@ const OfPayConstKey = {
|
|
|
uuid: 'lkOfPayUUID',
|
|
|
token: 'lkOfPayAuthorization',
|
|
|
cookie: 'lkOfPayCookie',
|
|
|
+ expireTime: 'lkOfPayExpireTime',
|
|
|
|
|
|
marketId: 'lkOfPayMarketId',
|
|
|
eventVisitorId: 'lkOfPayEventVisitorId',
|
|
|
@@ -234,6 +235,11 @@ function handleCookie(cookieStr){
|
|
|
}
|
|
|
customerInfo = JSON.parse(payload.customerInfo);
|
|
|
lk.setVal(OfPayConstKey.phone, customerInfo.phone);
|
|
|
+
|
|
|
+ let signDate = new Date(payload.iat*1000);
|
|
|
+ let expDate = new Date(payload.exp*1000);
|
|
|
+ let expTimeStr = lk.formatDate(expDate, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ lk.setVal(OfPayConstKey.expireTime, expTimeStr);
|
|
|
} catch (e) {
|
|
|
lk.log(`handleCookie error:${e}`);
|
|
|
}
|
|
|
@@ -274,12 +280,15 @@ function handleIndexLogin(){
|
|
|
let headers = $response.headers;
|
|
|
let newAuthorization = null;
|
|
|
if(headers['Set-Cookie']){
|
|
|
- lk.log(headers['Set-Cookie']);
|
|
|
+ // lk.log(headers['Set-Cookie']);
|
|
|
let cookieData = parseSetCookies(headers['Set-Cookie']);
|
|
|
for(let i=0; i < cookieData.length; i++){
|
|
|
let info = cookieData[i];
|
|
|
let name = info.name;
|
|
|
let value = info.value;
|
|
|
+ if(value == ''){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
gCookie[name] = value;
|
|
|
if(name == 'unionToken_interactiveIGoChoose'){
|
|
|
newAuthorization = value;
|
|
|
@@ -290,6 +299,16 @@ function handleIndexLogin(){
|
|
|
lk.log('刷新token');
|
|
|
let cookieStr = serializeCookies(gCookie);
|
|
|
lk.setVal(OfPayConstKey.cookie, cookieStr);
|
|
|
+
|
|
|
+ lk.setVal(OfPayConstKey.token, newAuthorization);
|
|
|
+ let jwtData = parseJwt(newAuthorization);
|
|
|
+ if(jwtData && jwtData.payload){
|
|
|
+ let payload = jwtData.payload;
|
|
|
+ let signDate = new Date(payload.iat*1000);
|
|
|
+ let expDate = new Date(payload.exp*1000);
|
|
|
+ let expTimeStr = lk.formatDate(expDate, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ lk.setVal(OfPayConstKey.expireTime, expTimeStr);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|