|
@@ -1,6 +1,7 @@
|
|
package com.boman.file.controller;
|
|
package com.boman.file.controller;
|
|
|
|
|
|
import com.boman.domain.dto.AjaxResult;
|
|
import com.boman.domain.dto.AjaxResult;
|
|
|
|
+import com.boman.domain.dto.Base64Dto;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -49,11 +50,12 @@ public class SysFileController
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 通用上传请求
|
|
|
|
|
|
+ * 通用上传请求 暂且如此处理,后来再优化
|
|
*/
|
|
*/
|
|
@PostMapping("/upload/base64")
|
|
@PostMapping("/upload/base64")
|
|
- public AjaxResult uploadFileBase64(@RequestBody String base64) {
|
|
|
|
|
|
+ public AjaxResult uploadFileBase64(@RequestBody Base64Dto dto) {
|
|
try {
|
|
try {
|
|
|
|
+ String base64 = dto.getFile();
|
|
String url = sysFileService.uploadFileBase64(base64);
|
|
String url = sysFileService.uploadFileBase64(base64);
|
|
AjaxResult ajax = AjaxResult.success();
|
|
AjaxResult ajax = AjaxResult.success();
|
|
ajax.put("name", FileUtils.getName(url));
|
|
ajax.put("name", FileUtils.getName(url));
|