Files
vippk-yy-template/build/html-template/core.html
T
2018-12-03 17:31:53 +08:00

67 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<script type="text/javascript" src="jquery-1.12.4.min.js?_=10095" ></script>
<script>
Array.prototype.indexOf2 = function (str) {
for (var i = 0; i < this.length; i++) {
if (str == this[i]) {
return i;
}
}
return -1;
}
var res = $.ajax({url:"config_tchannel.txt?t="+new Date().getTime(),async:false});
var result = $.parseJSON(res.responseText);
//读取本顶级频道长位id
var shortid = 0;
var yyexternal = window.external;
var retObj = "{}";
try{
retObj = yyexternal.IChannel_GetCurrentChannelInfo();
}
catch(e)
{
}
retObj = eval("(" + retObj +")");
if(retObj && retObj.ret == 0)
shortid = retObj.short_id;
var data = result;
var tests = data.tests;
var release = data.release;
var local = data.local;
var toUrl;
for(var i=tests.length-1;i>=0;i--)
{
var test = tests[i];
if(typeof(test) === "function"){
continue;
}
var channels = test.channels;
var ver = test.ver;
if(channels && channels.indexOf2(shortid.toString()) != -1){
toUrl = "publish/" + ver + "/index.html?t=" + new Date().getTime();
break;
}
}
if(!toUrl)
{
if(!local && release !="")
window.location.href = "publish/" + release + "/index.html?t=" + new Date().getTime();
else
window.location.href = "index.html?t=" + new Date().getTime();
}
else
{
window.location.href = toUrl;
}
</script>
</head>