mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-02-14 10:24:27 +08:00
update 请求响应对象 与 分页对象 结构修改 适配接口文档配置
This commit is contained in:
@@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -88,10 +90,10 @@ public class CaptchaController {
|
||||
code = captcha.getCode();
|
||||
}
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", captcha.getImageBase64());
|
||||
return ajax;
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
|
||||
private String getCodeResult(String capStr) {
|
||||
|
||||
@@ -18,10 +18,12 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@@ -34,7 +36,7 @@ public class CommonController
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@@ -77,10 +79,10 @@ public class CommonController
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("url", url);
|
||||
return ajax;
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user