通知:由于图片服务器所在机房网络故障, 原有数据仍然需要时间修复,9.14后更新的漫画章节可以正常阅读
MIP.util.platform.start()
if(window.location.origin != 'https://m.happymh.com'){
MIP.setData({sys:{isHost:false}});
}
MIP.setData({"sys":{"linkType":"html"}})
var storage = MIP.util.customStorage(0);
var user = storage.get("_u");
var uBookcase = storage.get("_bc");
var uHistory = storage.get("_ht");
var bc_time = storage.get("_bc_time");
if(user !== null){
user = JSON.parse(user)
uBookcase = JSON.parse(uBookcase)
uHistory = JSON.parse(uHistory)
MIP.setData({"user":{"detail":user,"uHistory":uHistory ? uHistory : [],"uBookcase": uBookcase ? uBookcase : [],"bc_time":bc_time}});
}
MIP.watch('user.changeTime', function (newVal, oldVal) {
if(newVal !== 0){
var user = MIP.getData("user");
var detail = user.detail;
var bookcase = user.uBookcase;
var history = user.uHistory;
storage.set("_u",JSON.stringify(detail));
storage.set("_bc",JSON.stringify(bookcase));
storage.set("_ht",JSON.stringify(history));
storage.set("_bc_time",user.bc_time);
}
})
MIP.watch('user.action', function (newVal, oldVal) {
if(newVal === 'exit'){
localStorage.clear();
var expireOld = new Date((new Date()).getTime() - 24 * 3600000 * 365);
var host = location.host;
var mainHost = host.replace('m.', '.');
document.cookie = "sf_token=1; expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/ ; domain="+mainHost;
document.cookie = "sf_token=1; expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/ ; domain="+host;
document.cookie = "sf_token=1; expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/";
}
})
MIP.watch('sys.toastMsg.visible', function (newVal, oldVal) {
var toastConfig = MIP.getData("sys.toastMsg");
if(newVal === true){
setTimeout(function(){
MIP.setData({sys:{toastMsg:{visible:false}}})
},toastConfig.timeout)
}
})