fix: 修复后台面板无法访问的问题 (#490)

This commit is contained in:
HalcyonAlcedo 2023-06-25 12:24:31 +08:00 committed by GitHub
parent 5bfd55e765
commit 7bc140a030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View file

@ -10,6 +10,7 @@ async function routes(fastify, options) {
fastify.get('/help/*', async (request, reply) => {
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
reply.type('text/html').send(stream)
return reply
})
fastify.get('/version', async (request, reply) => {
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
@ -19,6 +20,7 @@ async function routes(fastify, options) {
fastify.get('/auth/*', async (request, reply) => {
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
reply.type('text/html').send(stream)
return reply
})
fastify.get('/admin*', async (request, reply) => {
const token = request.cookies.token || request.body?.token || 'unknown'