Skip to content

Commit

Permalink
fix: 修复检查更新源&更多的flag
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyJan committed Dec 4, 2023
1 parent 830adb6 commit bd903f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ git -C ./plugins/Yunzai-Kuro-Plugin/ pull

### 咕咕咕

(可能 11 月中下旬开始继续更新咕咕咕)
(可能 12 月中下旬开始继续更新咕咕咕)

- [x] 代码重构: 将所有fetch请求提取到一个方法
- [ ] 代码重构: logger 套娃
Expand All @@ -93,8 +93,15 @@ git -C ./plugins/Yunzai-Kuro-Plugin/ pull
- [ ] 自动任务运行中记录运行进度, 以便重启后/第一次起洞时继续运行
- [ ] 精简日志输出
- [ ] 签到判断全勤增加提示
- [ ] token 刷新 (应该是用 refreshToken 但是抓不到包)
- [ ] ~~token 刷新 (应该是用 refreshToken 但是抓不到包)~~ 库洛好像不再刷新 token 了
- [ ] 大工程: 库街区角色信息查询
- [ ] 清理忘了删掉的日志输出http请求信息
- [ ] 检查更新用自己域名代理或者其他方案
- [ ] 战双签到 指令的时间估计
- [ ] 修复 token 失效判定错误 (可能是用来判定的api不要ck了?)
![image-20231116133326567](C:\Users\TomyJan\AppData\Roaming\Typora\typora-user-images\image-20231116133326567.png)
- [ ] 修复 `库洛token登录`指令返回两条消息的问题
- [ ] 增加 游戏签到 补签功能

## 关于

Expand Down
16 changes: 11 additions & 5 deletions model/autoTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ export async function checkUpdateTask() {
if (!remoteVersion) {
remoteVersion = await getRemoteVersion('GHProxy')
if (!remoteVersion) {
logger.warn(`[库洛插件] 检查更新任务失败`)
await sendMsgFriend(cfg.masterQQ[0], `[库洛插件]自动检查更新失败!`)
return false
remoteVersion = await getRemoteVersion('TomyJan')
if (!remoteVersion) {
logger.warn(`[库洛插件] 检查更新任务失败`)
await sendMsgFriend(cfg.masterQQ[0], `[库洛插件]自动检查更新失败!`)
return false
}

}
}
remoteVersion = remoteVersion.match(/\[(.*?)\]\(.*?\)/)[1] || false
Expand Down Expand Up @@ -212,10 +216,12 @@ export async function checkUpdateTask() {
}

async function getRemoteVersion(type) {
logger.debug(`[库洛插件] 尝试从 ${type} 检查更新...`)
let checkUrl =
'https://github.com/TomyJan/Yunzai-Kuro-Plugin/raw/master/CHANGELOG.md'
if (type == 'GHProxy') checkUrl = 'https://ghproxy.com/' + checkUrl
try {
if (type == 'GHProxy') checkUrl = 'https://mirror.ghproxy.com/' + checkUrl
if (type == 'TomyJan') checkUrl = 'https://www.tomys.top/yunzai-kuro-plug-vercheck'
try {
let rsp = await fetch(checkUrl)
if (!rsp.ok) {
logger.warn(
Expand Down

0 comments on commit bd903f6

Please sign in to comment.