diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index e0ef8e36d..d3da68e1a 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/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) { diff --git a/modules/web/src/components/SourceTabForm.vue b/modules/web/src/components/SourceTabForm.vue index ee7e7c052..612cb29ba 100644 --- a/modules/web/src/components/SourceTabForm.vue +++ b/modules/web/src/components/SourceTabForm.vue @@ -5,7 +5,7 @@ :label="name" :key="name" > - + ::或者{url:,title:,style:...};前者用换行符或者&&连接,后者放在数组内;可用js动态生成", }, - { - title: "发现筛选", - id: "exploreScreen", - type: "String", - hint: "发现筛选规则", - }, { title: "列表规则", namespace: "ruleExplore", @@ -318,13 +312,6 @@ export default { type: "String", hint: "选择书籍详情页网址 (规则结果为String类型的url, 与详情页相同时可省略)", }, - { - title: "下载URL", - namespace: "ruleBookInfo", - id: "downloadUrls", - type: "String", - hint: "文件类书源下载地址 (规则结果为String类型的url, 多个链接返回数组)", - }, { title: "修改书籍", namespace: "ruleBookInfo", @@ -332,13 +319,20 @@ export default { type: "String", hint: "允许修改书名作者(规则结果为String类型, 默认不允许)", }, + { + title: "下载URL", + namespace: "ruleBookInfo", + id: "downloadUrls", + type: "String", + hint: "文件类书源下载地址 (规则结果为String类型的url, 多个链接返回数组)", + }, ], }, directory: { 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", @@ -461,13 +455,6 @@ export default { type: "String", hint: "FULL:铺满 不填:默认样式", }, - { - title: "购买操作", - namespace: "ruleContent", - id: "payAction", - type: "String", - hint: "填写JavaScript 返回购买链接或者调用购买接口", - }, { title: "图片解密", namespace: "ruleContent", @@ -475,6 +462,13 @@ export default { type: "String", hint: "填写JavaScript 返回解密图片的bytes ", }, + { + title: "购买操作", + namespace: "ruleContent", + id: "payAction", + type: "String", + hint: "填写JavaScript 返回购买链接或者调用购买接口", + }, ], }, /* @@ -572,7 +566,7 @@ id: "deleteUrl", // type: "Boolean", // }, { - title: "Cookie", + title: "CookieJar", id: "enabledCookieJar", type: "Boolean", },