Skip to content

Commit

Permalink
fix: 优化token检测
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 25, 2023
1 parent d85f950 commit d43f6b4
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 95 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ Support features such as fast publishing, image bed management, platform expansi

**Front Row Announcement: the first AI-integrated version `1.10.0` of the Publish Tool is released!**

We recommend updating using the `uninstall->install` method. If there are any configuration issues, please back up `[workspace]/data/storage/syp/sy-p-plus-cfg.json`, then delete it, as this configuration file will be automatically initialized on first use.

## Recent Key Updates and Bug Fixes
## Update history

- Support for manually generating titles, summaries, tags, and categories through AI.
- AI integration.
- Support for multiple publishing views: simple mode, detailed mode, and source code mode.
- Support for summaries, tags, categories, and knowledge spaces.
- Platforms that do not support image link replacement can use the platform's built-in image upload interface.
- Support for replacing image links with the Picgo plugin, if available.
Please check [CHANGELOG](./CHANGELOG.MD)

## Platform List

Expand Down Expand Up @@ -78,10 +71,6 @@ the [Siyuan Note Publishing Tool Plugin Platform Adaptation Tracking Form](https
For platform adaptation, please refer
to [Latest Adaptation](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd)

## Update history

Please check [CHANGELOG](./CHANGELOG.MD)

## FAQ

* Q1:How to install the publishing tool plugin? Where can I find his entrance after installation?
Expand Down
15 changes: 2 additions & 13 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@

> **前排公告:发布工具首个AI集成版本 `1.10.0` 发布!**
我们建议您使用 `卸载->安装` 方法进行更新。如果配置异常,请备份 `[workspace]/data/storage/syp/sy-p-plus-cfg.json` ,然后删除,这个配置文件会在第一次使用时自动初始化。

## 最近的关键更新与 Bug 修复
## 更新历史

- 支持手动通过AI生成标题、摘要、标签、分类
- AI集成
- 支持多种发布视图,简单模式、详细模式和源码模式
- 支持摘要、标签、分类、知识空间
- 不支持图片链接替换的平台支持使用平台自带的图片上传接口
- 支持使用Picgo插件的情况下替换图床图片链接
请直接查看 [CHANGELOG](./CHANGELOG.md)

## 平台列表

Expand Down Expand Up @@ -74,10 +67,6 @@

平台适配情况请查看请参考 [最新适配情况](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd)

## 更新历史

请直接查看 [CHANGELOG](./CHANGELOG.md)

## FAQ

* Q1:发布工具插件怎么安装?安装之后在哪里找到他的入口?
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/crypto-js": "^4.1.1",
"@types/node": "^18.17.11",
"@vitejs/plugin-vue": "^4.3.3",
"@vitest/coverage-v8": "^0.34.2",
"@vitest/coverage-v8": "^0.34.3",
"@vue/test-utils": "^2.4.1",
"esbuild-plugin-copy": "^2.1.1",
"esbuild-style-plugin": "^1.6.2",
Expand All @@ -48,7 +48,7 @@
"vite": "^4.4.9",
"vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.11.3",
"vitest": "^0.34.2",
"vitest": "^0.34.3",
"vue-tsc": "^1.8.8"
},
"dependencies": {
Expand All @@ -72,14 +72,14 @@
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.4",
"xmlbuilder2": "^3.1.1",
"zhi-blog-api": "^1.34.10",
"zhi-blog-api": "^1.34.12",
"zhi-common": "^1.23.5",
"zhi-device": "^2.3.1",
"zhi-fetch-middleware": "^0.3.9",
"zhi-github-middleware": "^0.3.9",
"zhi-lib-base": "^0.4.4",
"zhi-notion-markdown": "^0.1.4",
"zhi-siyuan-api": "^2.5.13",
"zhi-siyuan-api": "^2.5.15",
"zhi-xmlrpc-middleware": "^0.5.9"
}
}
99 changes: 47 additions & 52 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions src/components/publish/BatchPublishIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,19 @@ const handleRefresh = () => {
const checkChatGPTEnabled = () => {
let flag = false
try {
useChatGPT()
flag = true
} catch (e) {
logger.error(t("main.opt.failure") + "=>", e)
let attempts = 0
while (!flag && attempts < 3) {
try {
useChatGPT()
flag = true
} catch (e) {
logger.error(`${t("main.opt.failure")} => ${e}`)
attempts++
}
}
logger.info(`第${attempts}次尝试就检测AI状态: ${flag}`)
return flag
}
Expand Down Expand Up @@ -558,4 +565,4 @@ onMounted(async () => {
.distri-tip-alert
margin 10px 0
padding: 2px 0
</style>
</style>
Loading

0 comments on commit d43f6b4

Please sign in to comment.