@nestim/koishi-plugin-qqgm-webui 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -62,8 +62,8 @@ function apply(ctx, config) {
|
|
|
62
62
|
return true;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const sendFile = (koa, file) => {
|
|
66
|
-
if (!guard(koa)) return;
|
|
65
|
+
const sendFile = (koa, file, needGuard = true) => {
|
|
66
|
+
if (needGuard && !guard(koa)) return;
|
|
67
67
|
const full = path.join(root, file);
|
|
68
68
|
if (!full.startsWith(root) || !fs.existsSync(full)) {
|
|
69
69
|
koa.status = 404;
|
|
@@ -88,13 +88,13 @@ function apply(ctx, config) {
|
|
|
88
88
|
koa.redirect(`${route}/${qs}`);
|
|
89
89
|
});
|
|
90
90
|
ctx.server.get(`${route}/`, (koa) => sendFile(koa, 'index.html'));
|
|
91
|
-
ctx.server.get(`${route}/styles.css`, (koa) => sendFile(koa, 'styles.css'));
|
|
92
|
-
ctx.server.get(`${route}/app.js`, (koa) => sendFile(koa, 'app.js'));
|
|
91
|
+
ctx.server.get(`${route}/styles.css`, (koa) => sendFile(koa, 'styles.css', false));
|
|
92
|
+
ctx.server.get(`${route}/app.js`, (koa) => sendFile(koa, 'app.js', false));
|
|
93
93
|
|
|
94
94
|
ctx.server.get(`${route}/api/health`, (koa) => json(koa, {
|
|
95
95
|
ok: true,
|
|
96
96
|
name,
|
|
97
|
-
version: '0.2.
|
|
97
|
+
version: '0.2.6',
|
|
98
98
|
route,
|
|
99
99
|
tokenRequired: !!config.token,
|
|
100
100
|
remoteAllowed: !!config.allowRemote,
|