Horis 2 lat temu
rodzic
commit
3a20b18316

+ 2 - 2
app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@@ -153,9 +153,9 @@ class AnalyzeRule(
                     sourceRule.rule
                 } else {
                     // 键值直接访问
-                    result[sourceRule.rule]?.toString()
+                    result[sourceRule.rule]
                 }?.let {
-                    replaceRegex(it, sourceRule)
+                    replaceRegex(it.toString(), sourceRule)
                 }
             } else {
                 for (sourceRule in ruleList) {

+ 1 - 1
modules/web/src/components/SourceTabForm.vue

@@ -5,7 +5,7 @@
       :label="name"
       :key="name"
     >
-      <el-form label-position="right" label-width="5em">
+      <el-form label-position="right" label-width="auto">
         <el-form-item
           v-for="{
             type,

+ 46 - 52
modules/web/src/config/bookSourceEditConfig.js

@@ -35,12 +35,6 @@ export default {
         type: "String",
         hint: "描述源作者和状态",
       },
-      {
-        title: "书源变量",
-        id: "variableComment",
-        type: "String",
-        hint: "书源变量说明",
-      },
       {
         title: "登录地址",
         id: "loginUrl",
@@ -66,16 +60,10 @@ export default {
         hint: "封面解密js",
       },
       {
-        title: "并发率",
-        id: "concurrentRate",
-        type: "String",
-        hint: "并发率,如1000(访问间隔1000ms)或者1/1000(1000ms内访问1次)",
-      },
-      {
-        title: "js库",
-        id: "jsLib",
+        title: "链接验证",
+        id: "bookUrlPattern",
         type: "String",
-        hint: "js库, 可填写js或者key-value object获取在线js文件",
+        hint: "书籍URL正则,当详情页URL与源URL的域名不一致时有效,用于添加网址",
       },
       {
         title: "请求头",
@@ -84,10 +72,22 @@ export default {
         hint: "客户端标识",
       },
       {
-        title: "链接验证",
-        id: "bookUrlPattern",
+        title: "变量说明",
+        id: "variableComment",
         type: "String",
-        hint: "当详情页URL与源URL的域名不一致时有效,用于添加网址",
+        hint: "书源变量说明",
+      },
+      {
+        title: "并发率",
+        id: "concurrentRate",
+        type: "String",
+        hint: "并发率,如1000(访问间隔1000ms)或者1/1000(1000ms内访问1次)",
+      },
+      {
+        title: "js库",
+        id: "jsLib",
+        type: "String",
+        hint: "js库, 可填写js或者key-value object获取在线js文件",
       },
     ],
   },
@@ -181,12 +181,6 @@ export default {
         type: "String",
         hint: "单个发现格式<name>::<url>或者{url:<url>,title:<name>,style:...};前者用换行符或者&&连接,后者放在数组内;可用js动态生成",
       },
-      {
-        title: "发现筛选",
-        id: "exploreScreen",
-        type: "String",
-        hint: "发现筛选规则",
-      },
       {
         title: "列表规则",
         namespace: "ruleExplore",
@@ -319,18 +313,18 @@ export default {
         hint: "选择书籍详情页网址 (规则结果为String类型的url, 与详情页相同时可省略)",
       },
       {
-        title: "下载URL",
+        title: "修改书籍",
         namespace: "ruleBookInfo",
-        id: "downloadUrls",
+        id: "canReName",
         type: "String",
-        hint: "文件类书源下载地址 (规则结果为String类型的url, 多个链接返回数组)",
+        hint: "允许修改书名作者(规则结果为String类型, 默认不允许)",
       },
       {
-        title: "修改书籍",
+        title: "下载URL",
         namespace: "ruleBookInfo",
-        id: "canReName",
+        id: "downloadUrls",
         type: "String",
-        hint: "允许修改书名作者(规则结果为String类型, 默认不允许)",
+        hint: "文件类书源下载地址 (规则结果为String类型的url, 多个链接返回数组)",
       },
     ],
   },
@@ -338,7 +332,7 @@ export default {
     name: "目录",
     children: [
       {
-        title: "预处理",
+        title: "更新前JS",
         namespace: "ruleToc",
         id: "preUpdateJs",
         type: "String",
@@ -379,6 +373,13 @@ export default {
         type: "String",
         hint: "章节名称是否是卷名 (规则结果为Bool)",
       },
+      {
+        title: "章节信息",
+        namespace: "ruleToc",
+        id: "updateTime",
+        type: "String",
+        hint: "选择章节信息(如更新时间) (规则结果为String)",
+      },
       {
         title: "收费标识",
         namespace: "ruleToc",
@@ -393,13 +394,6 @@ export default {
         type: "String",
         hint: "章节是否为已购买 (规则结果为Bool)",
       },
-      {
-        title: "章节信息",
-        namespace: "ruleToc",
-        id: "updateTime",
-        type: "String",
-        hint: "选择章节信息 (规则结果为String)",
-      },
       {
         title: "翻页规则",
         namespace: "ruleToc",
@@ -412,13 +406,6 @@ export default {
   content: {
     name: "正文",
     children: [
-      {
-        title: "脚本注入",
-        namespace: "ruleContent",
-        id: "webJs",
-        type: "String",
-        hint: "注入javascript,用于模拟鼠标点击等,必须有返回值,一般为String类型",
-      },
       {
         title: "正文规则",
         namespace: "ruleContent",
@@ -440,6 +427,13 @@ export default {
         type: "String",
         hint: "选择下一分页(不是下一章)链接 (规则结果为String类型的Url)",
       },
+      {
+        title: "脚本注入",
+        namespace: "ruleContent",
+        id: "webJs",
+        type: "String",
+        hint: "注入javascript,用于模拟鼠标点击等,必须有返回值,一般为String类型",
+      },
       {
         title: "资源正则",
         namespace: "ruleContent",
@@ -462,18 +456,18 @@ export default {
         hint: "FULL:铺满 不填:默认样式",
       },
       {
-        title: "购买操作",
+        title: "图片解密",
         namespace: "ruleContent",
-        id: "payAction",
+        id: "imageDecode",
         type: "String",
-        hint: "填写JavaScript 返回购买链接或者调用购买接口",
+        hint: "填写JavaScript 返回解密图片的bytes ",
       },
       {
-        title: "图片解密",
+        title: "购买操作",
         namespace: "ruleContent",
-        id: "imageDecode",
+        id: "payAction",
         type: "String",
-        hint: "填写JavaScript 返回解密图片的bytes ",
+        hint: "填写JavaScript 返回购买链接或者调用购买接口",
       },
     ],
   },
@@ -572,7 +566,7 @@ id: "deleteUrl",
       //   type: "Boolean",
       // },
       {
-        title: "Cookie",
+        title: "CookieJar",
         id: "enabledCookieJar",
         type: "Boolean",
       },