mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
修复错误
This commit is contained in:
@@ -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
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user