Authored by 沈志敏

对外暴露uid

{
"name": "yoho-js-sdk",
"version": "1.1.6",
"version": "1.1.7",
"description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。",
"keywords": [
"YOHO!",
... ...
... ... @@ -25,5 +25,8 @@ export default {
favout: user.favout,
getMktCode: function(){
return user.getMktCode();
},
getUid: function(){
return user.uid;
}
};
\ No newline at end of file
... ...
... ... @@ -3,9 +3,31 @@
*/
import utils from './utils';
const channelMap = {
'baidu.com': 100000000000055,
'so.com': 100000000000049,
'sogou.com': 100000000000053,
'bing.com': 100000000000057,
'm.sm.cn': 100000000000059,
'google.com': 100000000000061
};
const getMktcBySeo = () => {
var mktc,
rf = document.referrer;
for (var domain in channelMap) {
if (rf.indexOf(domain) > -1) {
mktc = channelMap[domain];
break;
}
}
return mktc;
};
const getAppPath = () => {
let qs = utils.queryString();
let ct = qs.mkt_code || qs.union_type;
let ct = qs.mkt_code || qs.union_type || getMktcBySeo() || '100000000000349';
delete qs.openapp; // 防止重复打开
... ...