修复bug (#321)

This commit is contained in:
HalcyonAlcedo 2023-04-07 16:32:24 +08:00 committed by GitHub
parent 0a0cefe39c
commit 3b66f6d3f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 44 additions and 11 deletions

View file

@ -49,6 +49,7 @@ export async function createServer() {
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
reply.type('text/html').send(stream)
})
// 页面数据获取
server.post('/page', async (request, reply) => {
const body = request.body || {}
if (body.code) {
@ -60,6 +61,7 @@ export async function createServer() {
reply.send(data)
}
})
// 帮助内容获取
server.post('/help', async (request, reply) => {
const body = request.body || {}
if (body.use) {
@ -71,6 +73,7 @@ export async function createServer() {
reply.send(data[body.use])
}
})
// 创建页面缓存内容
server.post('/cache', async (request, reply) => {
const body = request.body || {}
if (body.content) {
@ -83,7 +86,7 @@ export async function createServer() {
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(filepath, JSON.stringify({
user: body.content.senderName,
bot: (body.bing ? 'Bing' : 'ChatGPT'),
bot: Config.chatViewBotName || (body.bing ? 'Bing' : 'ChatGPT'),
userImg: body.userImg || '',
botImg: body.botImg || '',
question: body.content.prompt,

File diff suppressed because one or more lines are too long

View file

@ -17,4 +17,4 @@
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-->
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"/><script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script><title>ChatGPT-Plugin</title><script defer="defer" src="/js/chunk-vendors.41e7b735.js"></script><script defer="defer" src="/js/app.6b32cca7.js"></script><link href="/css/chunk-vendors.016e0765.css" rel="stylesheet"><link href="/css/app.432d8899.css" rel="stylesheet"></head><body class="text-blueGray-700 antialiased"><noscript><strong>We're sorry but vue-notus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"/><script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.6.3/mermaid.min.js"></script><title>ChatGPT-Plugin</title><script defer="defer" src="/js/chunk-vendors.bc8c7ae8.js"></script><script defer="defer" src="/js/app.4195158e.js"></script><link href="/css/chunk-vendors.f10f650e.css" rel="stylesheet"><link href="/css/app.6561b27a.css" rel="stylesheet"></head><body class="text-blueGray-700 antialiased"><noscript><strong>We're sorry but vue-notus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long