Skip to content

Commit a178745

Browse files
committed
使用post提交
1 parent cc2705c commit a178745

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

docs/install.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ TianliGPT适用于几乎所有主题,你可以轻松的更改几个变量,
2020
| [hexo-theme-redefine](https://github.com/zhheo/Post-Abstract-AI/issues/42) | .article-content.markdown-body | 无需添加 ||
2121
| [hexo-theme-stellar](https://github.com/zhheo/Post-Abstract-AI/issues/1) | .md-text.content.post | 无需添加 ||
2222
| hexo-theme-volantis | #post #post-body | 无需添加 ||
23+
| [hexo-theme-solitude](./theme/hexo-theme-solitude) | #post #post-body | 无需添加 ||
2324
| hugo-theme-DoIt | .page.single:not(.special) .content | 无需添加 ||
2425
| [halo-theme-hao](./theme/halo-theme-hao) | 在后台配置 | 在后台配置 |
2526
| halo-theme-xue | #container .article-content #lightGallery | 无需添加 ||

docs/theme/hexo-theme-solitude.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## hexo-theme-solitude
22

3+
<div class="img_container">
4+
5+
![已接入文章摘要](https://bu.dusays.com/2024/04/18/6620a11060052.webp)
6+
<style>
7+
.img_container p {
8+
display: flex;
9+
gap: 8px;
10+
};
11+
</style>
12+
</div>
13+
314
详细配置信息前往 [Solitude 文档](https://solitude-docs.efu.me/third_party/tianliai) 查看。
415

516
```yaml

tianli_gpt.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,25 @@ function tianliGPT(usePjax) {
124124
}
125125
var url = window.location.href;
126126
const title = document.title;
127-
const apiUrl = `https://summary.tianli0.top/?content=${encodeURIComponent(content)}&key=${encodeURIComponent(tianliGPT_key)}&url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`;
127+
const apiUrl = 'https://summary.tianli0.top/';
128128
const timeout = 20000; // 设置超时时间(毫秒)
129129

130130
try {
131131
const controller = new AbortController();
132132
const timeoutId = setTimeout(() => controller.abort(), timeout);
133-
const response = await fetch(apiUrl, { signal: controller.signal });
133+
const response = await fetch(apiUrl, {
134+
method: 'POST',
135+
headers: {
136+
'Content-Type': 'application/json'
137+
},
138+
body: JSON.stringify({
139+
content: content,
140+
key: tianliGPT_key,
141+
url: window.location.href,
142+
title: document.title
143+
}),
144+
signal: controller.signal
145+
});
134146
clearTimeout(timeoutId); // 清除定时器,避免不必要的abort
135147

136148
if (response.ok) {

tianli_gpt.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)