mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
修复部分情况下,弹幕打开/关闭失败的bug
This commit is contained in:
parent
cf347cdf98
commit
e2f154516a
@ -1,34 +1,36 @@
|
||||
Array.prototype.indexOf = function (val) {
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] == val) return i;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
Array.prototype.remove = function (val) {
|
||||
var index = this.indexOf(val);
|
||||
if (index > -1) {
|
||||
this.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
var token = localStorage.getItem("token");
|
||||
if (token) {
|
||||
$.get("/user/isLogin", { "token": token}, function (data) {
|
||||
if(data.code != 1){//未登录
|
||||
$.get("/user/isLogin", {"token": token}, function (data) {
|
||||
if (data.code != 1) {//未登录
|
||||
localStorage.removeItem("token");
|
||||
}})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function readHistory() {
|
||||
|
||||
var books = localStorage.getItem("historyBooks");
|
||||
var bookIds = "-1929";
|
||||
if (books) {
|
||||
bookIds = JSON.parse(localStorage.getItem("historyBooks")).join(",");
|
||||
}
|
||||
Array.prototype.indexOf = function (val) {
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] == val) return i;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
Array.prototype.remove = function (val) {
|
||||
var index = this.indexOf(val);
|
||||
if (index > -1) {
|
||||
this.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function readHistory() {
|
||||
|
||||
var books = localStorage.getItem("historyBooks");
|
||||
var bookIds = "-1929";
|
||||
if (books) {
|
||||
bookIds = JSON.parse(localStorage.getItem("historyBooks")).join(",");
|
||||
}
|
||||
window.location.href = "/book/search?historyBookIds=" + bookIds;
|
||||
};
|
||||
window.location.href = "/book/search?historyBookIds=" + bookIds;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user