✨ feat(bookSource): 聚合书源适配阅读 app 并完善评论体验

- 聚合书源取代早期书源版本:发现页筛选宫格/分类宫格、x:t:m:d: 前缀搜索、
  fqtab 类型随书切换、段评气泡(内置六种样式可配);showCmt 能力检测,魔改版
  原地弹窗(点遮罩关闭)、官方阅读降级 startBrowser;jsLib 不引用规则变量,
  searchUrl 修正编码与作用域
- 评论页:注入绝对 API_BASE,修复弹窗 WebView 内切换排序/懒加载失败;
  externalBaseURL 识别 X-Forwarded-Proto,气泡 ident 不再硬编码 http;
  顶栏固定(拖拽把手)+评论区独立滚动
- 部署:证书方案从 certbot 迁移到 acme.sh(CERT_DIR 可配置);新增服务生命
  周期参数 --stop/--start/--no-restart/--no-autostart;--clean 一键清理全部
  部署内容(服务/nginx/二进制/证书,含 certbot 残留),acme.sh 定位抽为
  find_acme_sh 供 init/clean 共用
- 忽略 .codegraph 本地索引目录
This commit is contained in:
chenxin committed 2026-10-10 13:21:37 +08:00
1 parent 49d0a371fb
commit c3ddf659b0
7 files changed
+342 -76

No files matched your search

+5 -11
View File
@@ -124,23 +124,17 @@ func addReviewToContent(jsonResult, itemID string, r *http.Request) string {
}
}
// 获取基础 URL
// 获取基础 URL(反代场景识别 X-Forwarded-Proto,避免生成 http:// 被 301)
cfg := config.GetConfig()
baseURL := ""
if cfg != nil {
if r.Host != "" {
baseURL = externalBaseURL(r)
} else if cfg != nil {
host := cfg.Server.Host
if host == "0.0.0.0" {
host = "localhost"
}
port := cfg.Server.Port
scheme := "http"
// 检查是否来自外部请求
if r.Host != "" {
baseURL = scheme + "://" + r.Host
} else {
baseURL = scheme + "://" + host + ":" + port
}
baseURL = "http://" + host + ":" + cfg.Server.Port
}
// 生成带段评标记的内容