|
|
@@ -223,22 +223,24 @@ public class BaseApiController extends BaseController {
|
|
|
@SuppressWarnings("resource")
|
|
|
protected String handleBaseFiles(Result res, String path, boolean isPrivate, byte[] bs, String sign,
|
|
|
String uid,String fn) {
|
|
|
- String fileName = FileUtils.mosaicFileName(fn, isPrivate, path, StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
|
|
|
+ String fileName = FileUtils.mosaicFileName("", isPrivate, path, StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
|
|
|
OutputStream fos = null;
|
|
|
if (bs != null && bs.length>0) {
|
|
|
try {
|
|
|
if (isPrivate) {
|
|
|
- File filePath = new File(uploadPrivatePath);
|
|
|
+ File filePath = new File(uploadPrivatePath + fileName);
|
|
|
if(!filePath.exists()){
|
|
|
filePath.mkdirs();
|
|
|
}
|
|
|
+ fileName += "/"+ fn;
|
|
|
System.out.println("------------"+ uploadPrivatePath + fileName);
|
|
|
fos = new FileOutputStream(new File(uploadPrivatePath + fileName));
|
|
|
} else {
|
|
|
- File filePath = new File(uploadPath);
|
|
|
+ File filePath = new File(uploadPath + fileName);
|
|
|
if(!filePath.exists()){
|
|
|
filePath.mkdirs();
|
|
|
}
|
|
|
+ fileName += "/" + fn;
|
|
|
System.out.println("------------"+ uploadPath + fileName);
|
|
|
fos = new FileOutputStream(new File(uploadPath + fileName));
|
|
|
}
|