fix: add prefix / for filePath

This commit is contained in:
qwqVictor 2024-05-04 15:29:58 +08:00
parent b1cfed1c29
commit 63eb9b1bb6

View File

@ -53,7 +53,7 @@ app.get("/:sessionId/:shareName/*", async (req, res) => {
/** /**
* @type {string} * @type {string}
*/ */
const filePath = req.params[0]; const filePath = "/" + req.params[0];
const session = sessionPool.getSession(sessionId); const session = sessionPool.getSession(sessionId);
const tree = await utility.getTree(session, shareName); const tree = await utility.getTree(session, shareName);
@ -84,7 +84,7 @@ app.post("/:sessionId/:shareName/*", async (req, res) => {
/** /**
* @type {string} * @type {string}
*/ */
const filePath = req.params[0]; const filePath = "/" + req.params[0];
const session = sessionPool.getSession(sessionId); const session = sessionPool.getSession(sessionId);
const tree = await utility.getTree(session, shareName); const tree = await utility.getTree(session, shareName);
@ -130,7 +130,7 @@ app.put("/:sessionId/:shareName/*", async (req, res) => {
/** /**
* @type {string} * @type {string}
*/ */
const filePath = req.params[0]; const filePath = "/" + req.params[0];
const session = sessionPool.getSession(sessionId); const session = sessionPool.getSession(sessionId);
const tree = await utility.getTree(session, shareName); const tree = await utility.getTree(session, shareName);