|
@ -1,6 +1,7 @@ |
|
|
'use strict'; |
|
|
'use strict'; |
|
|
|
|
|
|
|
|
async function addEditFile (ctx, next) { |
|
|
async function addEditFile (ctx, next) { |
|
|
|
|
|
let message = '添加文件夹失败' |
|
|
try { |
|
|
try { |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
|
const data = ctx.request.body; |
|
|
const data = ctx.request.body; |
|
@ -14,7 +15,8 @@ async function addEditFile (ctx, next) { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (onefind) { |
|
|
if (onefind) { |
|
|
throw '文件夹名称重复' |
|
|
message = '已有同层级文件夹' |
|
|
|
|
|
throw message |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -33,7 +35,7 @@ async function addEditFile (ctx, next) { |
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`) |
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`) |
|
|
ctx.status = 400; |
|
|
ctx.status = 400; |
|
|
ctx.body = { |
|
|
ctx.body = { |
|
|
"message": '添加文件夹失败' |
|
|
"message": message |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|