修复错误

This commit is contained in:
purocean
2018-03-27 19:21:22 +08:00
parent dbf2e42386
commit 681112f513
2 changed files with 8 additions and 1 deletions
+4
View File
@@ -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)
+4 -1
View File
@@ -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}`)