Skip to content

Commit

Permalink
fix: 优化正式版不填入卡密的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
akl7777777 committed Feb 7, 2024
1 parent fce8cd6 commit e7fe1ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/customKeyStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ async function translate(query, source_lang, target_lang, translate_text, comple
const L = Date.now();
let targetText = ""; // 初始化拼接结果变量
let buffer = ""; // 新增 buffer 变量
let headers = {
"Content-Type": "application/json"
}
if (api_key) {
headers["Authorization"] = `Bearer ${api_key}`;
headers["Token"] = `${api_key}`;
}
(async () => {
await $http.streamRequest({
method: "POST",
url: url,
header: {
"Content-Type": "application/json",
"Authorization": `Bearer ${api_key}`,
"Token": `${api_key}`
},
header: headers,
body: {
model: model,
stream: true,
Expand Down
2 changes: 1 addition & 1 deletion src/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate",
"version": "2.1.7",
"version": "2.1.8",
"category": "translate",
"name": "Free ChatGPT",
"summary": "免秘钥免启动任何服务调用ChatGPT",
Expand Down

0 comments on commit e7fe1ac

Please sign in to comment.