var app_id = "zgxyjjb";
var app_version = "1.0";
// var deviceID = "d5641a89f414a13eb955cffaed896b7c";
var siteSource = 2;
var host = "www.xyshjj.cn";
function randomWord(e, t, n) {
var r = ""
, i = t
, o = ""
, a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
e && (i = Math.round(Math.random() * (n - t)) + t);
for (var s = 0; s < i; s++)
o = Math.round(Math.random() * (a.length - 1)),
r += a[o];
return r
}
function dateFormat(e, t, n) {
Date.prototype.Format = function(e, t) {
var n = {
"M+": (t ? this.getUTCMonth() : this.getMonth()) + 1,
"d+": t ? this.getUTCDate() : this.getDate(),
"h+": t ? this.getUTCHours() : this.getHours(),
"m+": t ? this.getUTCMinutes() : this.getMinutes(),
"s+": t ? this.getUTCSeconds() : this.getSeconds(),
"q+": Math.floor(((t ? this.getUTCMonth() : this.getMonth()) + 3) / 3),
S: t ? this.getUTCMilliseconds() : this.getMilliseconds()
};
/(y+)/.test(e) && (e = e.replace(RegExp.$1, ((t ? this.getUTCFullYear() : this.getFullYear()) + "").substr(4 - RegExp.$1.length)));
for (var r in n)
new RegExp("(" + r + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? n[r] : ("00" + n[r]).substr(("" + n[r]).length)));
return e
}
;
try {
return e.Format(t, n)
} catch (e) {
return console.log(e.stack),
null
}
}
//n:58a0481be87dda1fb9f038bfe3792af2
function getSecretParam(e, t) {
var n = a.md5(a.md5(e))
, r = randomWord(!1, 36)
, i = a.dateFormat(new Date, "yyyy-MM-ddThh:mm:ssZ", !0)
, o = o = a.md5((new Date).getTime() + "deviceID");
return JSON.stringify({
tenant: n,
nonce: r,
timestamp: i,
srcKey: n + r + i + t,
deviceID: o
});
}
function getToken(e) {
var t = a.a.getState().version
, n = a.a.getState().siteSource
, r = u.b.getSecretParam(e, t)
, i = u.b.sha1(r.srcKey + r.deviceID + "" + n);
return new Promise(function(o, a) {
c.a.post(d + "/api/getAppToken", {
sid: e,
deviceID: r.deviceID,
source: n,
sign: i
}, {
headers: {
tenant: r.tenant,
nonce: r.nonce,
timestamp: r.timestamp,
version: t
}
}).then(function(t) {
u.b.timeLocalStorage.setAge(.8 * t.data.expires_in * 1e3).set(e + "siteToken", t.data.authtoken),
o(t)
}).catch(function(e) {
a(e)
})
}
)
}
var paramJson = getSecretParam(app_id,app_version);
console.log(randomWord(false, 36, undefined));
console.log(dateFormat(new Date, "yyyy-MM-ddThh:mm:ssZ", !0));
var authtoken = getToken(app_id);
var sha_str = paramJson.srcKey + host + paramJson.deviceID + siteSource + (true ? authtoken : "");
console.log(sha_str);
console