Commit b2344164 authored by 廖旭伟's avatar 廖旭伟

bug修改

parent 71685c65
package com.mortals.xhx.base.system.upload.web; package com.mortals.xhx.base.system.upload.web;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -60,6 +61,7 @@ public class UploadController extends BaseController { ...@@ -60,6 +61,7 @@ public class UploadController extends BaseController {
String jsonStr = ""; String jsonStr = "";
try { try {
String filePath = uploadService.saveFileUpload(file, prePath, getCurUser()); String filePath = uploadService.saveFileUpload(file, prePath, getCurUser());
filePath = StrUtil.prependIfMissing(filePath, "/");
model.put("url", filePath); model.put("url", filePath);
model.put("fileName", file.getOriginalFilename()); model.put("fileName", file.getOriginalFilename());
model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
...@@ -122,5 +124,4 @@ public class UploadController extends BaseController { ...@@ -122,5 +124,4 @@ public class UploadController extends BaseController {
} }
} }
} }
\ No newline at end of file
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