更新
This commit is contained in:
parent
e50e7eac37
commit
07c0ee4030
@ -55,14 +55,16 @@ public class Base64Api {
|
||||
String filePath = DCConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
fileName = fileName.replace("/profile/upload", "");
|
||||
String fileNameNew = FileUploadUtils.upload(filePath, file);
|
||||
fileNameNew = fileNameNew.replace("/profile/upload", "");
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
// 获取文件的 Base64 编码
|
||||
String path = filePath + File.separator + fileName;
|
||||
String path = filePath + File.separator + fileNameNew;
|
||||
path = path.replace("profile", "");
|
||||
String base64 = loadAsBase64(path);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("base64", base64);
|
||||
ajax.put("url", fileName);
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
Loading…
Reference in New Issue
Block a user