Commit 591240c1 by 李进峰

增加错误日志

parent 1b75903b
...@@ -85,10 +85,20 @@ public class DeployController { ...@@ -85,10 +85,20 @@ public class DeployController {
String targetBotAccount = requestBody.getString("targetBotAccount"); String targetBotAccount = requestBody.getString("targetBotAccount");
String tmpFileFullPathStr = Initialize.AUDIO_DIR+tmpFileRelativePathStr; String tmpFileFullPathStr = Initialize.AUDIO_DIR+tmpFileRelativePathStr;
Path tmpFileFullPath = Paths.get(tmpFileFullPathStr); Path tmpFileFullPath = Paths.get(tmpFileFullPathStr);
if(Files.exists(tmpFileFullPath) if(!Files.exists(tmpFileFullPath) && Files.isDirectory(tmpFileFullPath) ) {
&& !Files.isDirectory(tmpFileFullPath) ServerResponse<Object> result = ServerResponse.createByError();
&& StringUtils.endsWith(tmpFileRelativePathStr,".mp3") result.setMsg("缓存文件不存在!");
&& tmpFileRelativePathStr.startsWith("/game_editor_tmp")) { log.error(tmpFileFullPath.toString()+"路径不存在,或者是目录");
return result;
}
if(!StringUtils.endsWith(tmpFileRelativePathStr,".mp3")
&& !tmpFileRelativePathStr.startsWith("/game_editor_tmp")) {
ServerResponse<Object> result = ServerResponse.createByError();
result.setMsg("地址前缀或者后缀有问题!");
log.error(tmpFileFullPath.toString()+"路径不存在,或者是目录");
return result;
}
try { try {
String tmpFileRelativePathStr2 = tmpFileRelativePathStr.substring("/game_editor_tmp".length()); String tmpFileRelativePathStr2 = tmpFileRelativePathStr.substring("/game_editor_tmp".length());
if(tmpFileRelativePathStr2.startsWith(File.separator+targetBotAccount)) { if(tmpFileRelativePathStr2.startsWith(File.separator+targetBotAccount)) {
...@@ -107,12 +117,10 @@ public class DeployController { ...@@ -107,12 +117,10 @@ public class DeployController {
return ServerResponse.createBySuccess(targetFileRelativePathStr); return ServerResponse.createBySuccess(targetFileRelativePathStr);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} log.error("请求体:"+requestBody);
}
return ServerResponse.createByError(); return ServerResponse.createByError();
} }
}
@GetMapping("/background/audio") @GetMapping("/background/audio")
public ServerResponse moveTempToCertain(String path, @RequestParam(required = false) String oldPath) { public ServerResponse moveTempToCertain(String path, @RequestParam(required = false) String oldPath) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment