diff --git a/app/src/main/assets/help/jsHelp.md b/app/src/main/assets/help/jsHelp.md index aeeedf3f3..804dd0d87 100644 --- a/app/src/main/assets/help/jsHelp.md +++ b/app/src/main/assets/help/jsHelp.md @@ -189,10 +189,17 @@ source.getVariable() * 登录头操作 ``` source.getLoginHeader() -source.getLoginHeaderMap(): Map? +source.getLoginHeaderMap().get(key: String) source.putLoginHeader(header: String) source.removeLoginHeader() ``` +* 用户登录信息操作 +> 使用`登录UI`规则,并成功登录,阅读自动加密保存登录UI规则中除type为button的信息 +``` +source.getLoginInfo() +source.getLoginInfoMap().get(key: String) +source.removeLoginInfo() +``` ## cookie对象的部分可用函数 ``` 获取全部cookie diff --git a/app/src/main/assets/help/ruleHelp.md b/app/src/main/assets/help/ruleHelp.md index 3ddc61526..cf6541c3f 100644 --- a/app/src/main/assets/help/ruleHelp.md +++ b/app/src/main/assets/help/ruleHelp.md @@ -11,6 +11,36 @@ : regex规则,不可省略,只可以用在书籍列表和目录列表 ``` +* 登录UI +> 不使用内置webView登录网站,需要使用`登录URL`规则实现登录逻辑,可使用`登录检查JS`检查登录结果 +``` +规则填写示范 +[ + { + name: "telephone", + type: "text" + }, + { + name: "password", + type: "password" + }, + { + name: "注册", + type: "button", + action: "http://www.yooike.com/xiaoshuo/#/register?title=%E6%B3%A8%E5%86%8C" + } +] +成功登录后在js中获取读取登录信息 +source.getLoginInfo() +source.getLoginInfoMap().get("telephone") +登录信息示范 +{ + "telephone":"123456", + "password":"123456" +} + +``` + * 发现url格式 ```json [ @@ -104,3 +134,6 @@ let options = { ``` +* 购买操作 +> 返回购买链接,可直接填写链接或者JavaScript +> 可用变量 book chapter \ No newline at end of file diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index ddd0ae7a9..1eda788b7 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,13 +11,15 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! +**2020/01/17** +* 添加payAction规则,返回购买链接 +* 书源编辑中的辅助键盘❓中可查看js说明文档 + **2022/01/11** * 紧急修复在线tts朗读bug * 紧急修复登录问题 * 添加isVolume规则,支持二级目录,正文标题显示优化 by Xwite -* 书源编辑界面显示payAction规则 -* 书源编辑中的辅助键盘❓中可查看js说明文档 **2022/01/10** diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 4aa72b8f7..28ba6e57f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -842,7 +842,7 @@ class ReadBookActivity : BaseReadBookActivity(), startActivity { putExtra("title", getString(R.string.chapter_pay)) putExtra("url", it) - IntentData.put(it, ReadBook.bookSource) + IntentData.put(it, ReadBook.bookSource?.getHeaderMap(true)) } } }.onError {