You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.7 KiB
60 lines
1.7 KiB
;(function () {
|
|
// window.isNet = function (aa,bb){
|
|
// console.log('aa,bb :>> ', aa,bb);
|
|
|
|
// }
|
|
window._smReadyFuncs = []
|
|
window.SMSdk = {
|
|
ready: function (fn) {
|
|
fn && _smReadyFuncs.push(fn)
|
|
}
|
|
}
|
|
window._smConf = {
|
|
organization: 'oa7yDAg8CGEcbAd7a25V',
|
|
staticHost: 'static.fengkongcloud.com'
|
|
}
|
|
var url = (function () {
|
|
var originHost = 'static2.fengkongcloud.com'
|
|
var isHttps = 'https:' === document.location.protocol
|
|
var protocol = isHttps ? 'https://' : 'http://'
|
|
var fpJsPath = '/fpv2.js'
|
|
var url = protocol + _smConf.staticHost + fpJsPath
|
|
var ua = navigator.userAgent.toLowerCase()
|
|
var isWinXP = /windows\s(?:nt\s5.1)|(?:xp)/.test(ua)
|
|
var isLowIE = /msie\s[678]\.0/.test(ua)
|
|
if (isHttps && isWinXP && isLowIE) {
|
|
url = protocol + originHost + fpJsPath
|
|
}
|
|
return url
|
|
})()
|
|
var sm = document.createElement('script')
|
|
var s = document.getElementsByTagName('script')[0]
|
|
sm.src = url
|
|
$.ajax({
|
|
type: "GET",
|
|
url: url,
|
|
dataType: "text",
|
|
complete:function (XMLHttpRequest, textStatus) {
|
|
// this; // 调用本次AJAX请求时传递的options参数
|
|
console.log('XMLHttpRequest,textStatus :>> ', XMLHttpRequest,textStatus);
|
|
if(textStatus === "success"){
|
|
window.isOnLine = true;
|
|
console.log("window.isOnLine :>> ", window.isOnLine);
|
|
}
|
|
|
|
}
|
|
});
|
|
s.parentNode.insertBefore(sm, s)
|
|
})()
|
|
|
|
|
|
window.getDeviceParams = function (mobile, callback) {
|
|
var fkParams = {},
|
|
fkParamsStr = ''
|
|
fkParams.phone = mobile
|
|
SMSdk.ready(function () {
|
|
fkParams.deviceId = SMSdk.getDeviceId()
|
|
fkParamsStr = Base64.encodeURI(JSON.stringify(fkParams))
|
|
if (callback) callback(fkParamsStr)
|
|
})
|
|
}
|
|
|