PC 端 页面 head

This commit is contained in:
make
2025-04-06 15:31:29 +08:00
parent 57fad274d2
commit cf685cd7b4
20 changed files with 418 additions and 514 deletions

View File

@@ -126,9 +126,7 @@ function incShouCangFun(intId) {
function addBookshelfFun(NovelInfo) {
if (!NovelInfo) {
NovelInfo = JSON.parse(arrNovel)
NovelInfo['c_sort_num'] = strChapterSort;
NovelInfo['c_name'] = strChapterName;
NovelInfo = arrNovel
}
let arrBookshelf = JSON.parse(localStorage.getItem('strBookshelfKey')) || [];
@@ -251,17 +249,14 @@ function displayBookshelf() {
// 加入阅读记录
function addHistoryFun(NovelInfo) {
// 如果没有传入 NovelInfo则使用 arrNovel 并补充字段
if (!NovelInfo) {
NovelInfo = JSON.parse(arrNovel);
NovelInfo['c_sort_num'] = strChapterSort;
NovelInfo['c_name'] = strChapterName;
NovelInfo = arrNovel
}
// 获取本地存储中的历史记录
let arrBookshelf = JSON.parse(localStorage.getItem('strHistoryKey')) || [];
// 检查书籍是否已存在
const index = arrBookshelf.findIndex(item => item.n_id === NovelInfo.n_id);
@@ -379,7 +374,7 @@ function displayHistory() {
// 方法1使用 fetch API
async function reportStats(data) {
try {
const response = await fetch('http://api.novel2.com/publish', {
const response = await fetch(strPushApi+'/publish', {
method: 'POST',
// mode: 'no-cors', // 添加这行
headers: {