zhangjinli 3 years ago
parent 04f093e7c7
commit 5e669c2e15

@ -49,6 +49,8 @@ public class UtilsController {
@Value("${web.uploadPath}")
private String path;
@Value("${web.cdn}")
private String cdn;
@Operation(summary = "上传")
@PostMapping("/upload")
@ -122,7 +124,7 @@ public class UtilsController {
res.replace("errno", 0);
JSONObject obj = new JSONObject();
obj.put("alt", fileName);
obj.put("url", "/upload/" + newFileName);
obj.put("url", cdn + "/upload/" + newFileName);
res.put("data", obj);
return res;
} catch (IOException e) {

@ -54,6 +54,7 @@ mybatis-plus:
web:
apiPath: com.zh.project0512.controller
uploadPath: /www/wwwroot/project0512/upload/
cdn: http://cdn.sws010.com
#springdoc:
# swagger-ui:

Loading…
Cancel
Save