Authored by 邱骏

修改session_key获取方式

... ... @@ -17,7 +17,7 @@ let isWechat = /micromessenger/i.test(navigator.userAgent);
let isApp = /yohobuy/i.test(navigator.userAgent);
let isWechatMiniProgram = /miniprogram/i.test(navigator.userAgent);
let app_info = {
uid: '0',
uid: 0,
session_key: '',
app_version: '',
client_type: ''
... ... @@ -90,8 +90,8 @@ function hideShare() {
}
function getParams() { // 获取登录相关信息
let app_uid = cookie.get('app_uid') || qs.uid || app_info.uid;
let app_session_key = cookie.get('app_session_key') || qs.session_key || app_info.session_key;
let app_uid = parseInt(app_info.uid, 10) || cookie.get('app_uid') || qs.uid;
let app_session_key = app_info.session_key || cookie.get('app_session_key') || qs.session_key;
let app_version = cookie.get('app_version') || qs.app_version || '';
let app_client_type = cookie.get('app_client_type') || qs.app_client_type || '';
... ... @@ -322,6 +322,21 @@ function initWebShare() {
if (appInterface) {
initWebShareButtons('app');
}
appInterface.triggerEvent(function(uid) {
if (parseInt(uid, 10)) {
app_info.uid = uid;
}
}, function() {}, {
method: 'get.uid'
});
appInterface.triggerEvent(function(sid) {
if (sid) {
app_info.session_key = sid;
}
}, function() {}, {
method: 'get.sessionId'
});
});
$('.web-share-buttons-container .button-download').hide();
} else if (isWechatMiniProgram) {
... ...