Commit ee773023 by 苗权威

Merge branch 'master' of http://192.168.1.81:8000/Foxes/SmartBox

parents 5f5c5e2f 591240c1
......@@ -79,10 +79,20 @@ public class DeployController {
String targetBotAccount = requestBody.getString("targetBotAccount");
String tmpFileFullPathStr = Initialize.AUDIO_DIR+tmpFileRelativePathStr;
Path tmpFileFullPath = Paths.get(tmpFileFullPathStr);
if(Files.exists(tmpFileFullPath)
&& !Files.isDirectory(tmpFileFullPath)
&& StringUtils.endsWith(tmpFileRelativePathStr,".mp3")
&& tmpFileRelativePathStr.startsWith("/game_editor_tmp")) {
if(!Files.exists(tmpFileFullPath) && Files.isDirectory(tmpFileFullPath) ) {
ServerResponse<Object> result = ServerResponse.createByError();
result.setMsg("缓存文件不存在!");
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 {
String tmpFileRelativePathStr2 = tmpFileRelativePathStr.substring("/game_editor_tmp".length());
if(tmpFileRelativePathStr2.startsWith(File.separator+targetBotAccount)) {
......@@ -101,12 +111,10 @@ public class DeployController {
return ServerResponse.createBySuccess(targetFileRelativePathStr);
} catch (Exception e) {
e.printStackTrace();
}
}
log.error("请求体:"+requestBody);
return ServerResponse.createByError();
}
}
@GetMapping("/background/audio")
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