讨论节点

This commit is contained in:
masnn committed 2020-05-26 13:07:17 +08:00
1 parent 5e51bd2fe0
commit 7d27e56018
20 files changed
+154 -47

No files matched your search

+2
View File
@@ -3,6 +3,7 @@ const { Route, Handler } = require('../service/server');
class FileDownloadHandler extends Handler {
async get({ id, secret, name }) {
if (name) name = Buffer.from(name, 'base64').toString();
this.response.attachment(name || id);
this.response.body = await file.get(id, secret);
}
@@ -10,6 +11,7 @@ class FileDownloadHandler extends Handler {
async function apply() {
Route('/fs/:id/:secret', module.exports.FileDownloadHandler);
Route('/fs/:id/:name/:secret', module.exports.FileDownloadHandler);
}
global.Hydro.handler.file = module.exports = {