mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
讨论节点
This commit is contained in:
1 parent
5e51bd2fe0
commit
7d27e56018
20 files changed
+154
-47
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user