diff --git a/backend/file.js b/backend/file.js index d3ca61fe..e69c53f1 100644 --- a/backend/file.js +++ b/backend/file.js @@ -8,6 +8,10 @@ const mkdirPSync = location => { let folders = parsedPathObj.dir.split(path.sep) folders.push(parsedPathObj.base) for(let part of folders) { + if (part.indexOf(':') > -1) { // 修复 Windows 下面路径错误 + continue + } + curDir = path.join(curDir, part) if (!fs.existsSync(curDir)) { fs.mkdirSync(curDir) diff --git a/backend/main.js b/backend/main.js index 58f96401..41db16ee 100644 --- a/backend/main.js +++ b/backend/main.js @@ -56,4 +56,7 @@ app.use(bodyParser({multipart: true})) app.use(async (ctx, next) => fileContent(ctx, next)) app.use(async (ctx, next) => attachment(ctx, next)) -app.listen(3000) +const port = 3000 +app.listen(port) + +console.log(`访问地址:http://localhost:${port}`)