test2.js 1.7 KB
///melody/mcktv/index.html?referURL=%5B%22http%3A%2F%2F222.68.210.101%3A9080%2Fhyperion.chimera%2Findex.jsp%3FAction%3DLogout%22%2C%22http%3A%2F%2F222.68.210.101%3A9080%2Fmelody%2Fsparrow.silkworm%2FindexNew.html%3FbackStatus%3D1%22%5D
///IptvRecommend/content/contentRecommendForEPG.do?recommendMap=%7B%22userId%22:%2219109004@etva%22,%22action%22:%2296%22,%22userAd%22:%22%22%7D
var  PAGE_DEFAULT_BACK_PATH = "../sparrow.silkworm/indexNew.html";
var TOPDRAW_EPG_BASE_SERVER="http://222.68.210.7:9080/";
var strReferUrl = decodeURIComponent('%5B%22http%3A%2F%2F222.68.210.101%3A9080%2Fhyperion.chimera%2Findex.jsp%3FAction%3DLogout%22%2C%22http%3A%2F%2F222.68.210.101%3A9080%2Fmelody%2Fsparrow.silkworm%2FindexNew.html%3FbackStatus%3D1%22%5D');
try{
    if(!strReferUrl&&PAGE_DEFAULT_BACK_PATH||0 == strReferUrl.indexOf('[')&&!JSON.parse(strReferUrl).length){
       console.log("1111");
    }
}catch(err){
    Log.error("error in judge default back==>"+err);
}
if (0 == strReferUrl.indexOf('[')) {//如果是新版数组referURL
    console.log("2222");
    var arrSplitRefer = JSON.parse(strReferUrl);
    var strBackUrl = arrSplitRefer.pop();//上一个页面的url
    console.log(strBackUrl);
    if (arrSplitRefer[0]) {//string,backpage之后的referURL
        strReferUrl = JSON.stringify(arrSplitRefer);
        console.log("=="+strReferUrl);
    } else {
        strReferUrl = strReferUrl.substr(strReferUrl.indexOf(']') + 1);
    }
    if (0 != strBackUrl.indexOf('http')) {
        strBackUrl = TOPDRAW_EPG_SERVER + strBackUrl;//这个的处理是为了双屏返回
    }
    console.log(strBackUrl);
    if (-1!=strBackUrl.indexOf("http")&&-1==strBackUrl.indexOf(TOPDRAW_EPG_BASE_SERVER)) {
        console.log("3333");
    }
 }