Authored by 沈志敏

2.1.0 版本

{
"name": "yas-jssdk",
"version": "2.0.0",
"version": "2.1.0",
"description": "YOHO!采集系统的前端js的开发包",
"keywords": ["YOHO!", "Acquisition", "System", "JS-SDK"],
"homepage": "",
... ...
/**
* 跨域发送信息工具库
*/
var util = require('./util');
var config = require('./config');
var yasPath = config.yasPath;
... ... @@ -22,10 +23,9 @@ var createCORSRequest = function(method, url) {
return xhr;
};
//发送图片方式
exports.imgSend = function(param, callback) {
var appVer = window.qs.app_version || window.qs.appVersion;
var appVer = util.getAppVersion();
if (window.appBaseLogs || appVer >= '5.2.1') {
// 从app中打开的wap页场合,走app的上报逻辑
return;
... ...
... ... @@ -138,14 +138,13 @@ exports.getGeo = function(callback) {
};
exports.queryString = function() {
var vars = [],
var vars = {},
hash,
i;
var hashes = window.location.search.slice(1).split('&');
for (i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
... ... @@ -175,4 +174,21 @@ exports.getChannel = function() {
kids: 3,
lifestyle: 4
}[cookie('_Channel')];
}
var _getAppVersionByUa = function() {
var vars = navigator.userAgent.split(';') || [];
for (var i = 0; i < vars.length; i++) {
if (vars[i].indexOf('app_version') > -1) {
return vars[i].split('=')[1];
}
}
}
exports.getAppVersion = function() {
var appVer = window.qs.app_version || window.qs.appVersion;
if (!appVer) {
appVer = _getAppVersionByUa();
}
return appVer;
}
\ No newline at end of file
... ...