更新工具箱适配代码

This commit is contained in:
Alcedo 2023-08-31 09:52:49 +08:00
parent 6ace8720c4
commit c3d998ec34
25 changed files with 29 additions and 31 deletions

View file

@ -12,9 +12,8 @@ async function routes(fastify, options) {
reply.type('text/html').send(stream)
return reply
})
/*
fastify.get('/auth/*', async (request, reply) => {
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/page.html')
reply.type('text/html').send(stream)
return reply
})
@ -24,7 +23,7 @@ async function routes(fastify, options) {
if (!user) {
reply.redirect(301, '/auth/login')
}
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/page.html')
reply.type('text/html').send(stream)
return reply
})
@ -37,7 +36,7 @@ async function routes(fastify, options) {
if (user.autho === 'admin') {
reply.redirect(301, '/admin/settings')
}
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/page.html')
reply.type('text/html').send(stream)
return reply
})
@ -47,11 +46,10 @@ async function routes(fastify, options) {
if (!user || user.autho != 'admin') {
reply.redirect(301, '/admin/')
}
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/page.html')
reply.type('text/html').send(stream)
return reply
})
*/
}
export default routes