Przeglądaj źródła

fix json format

he2802 4 lat temu
rodzic
commit
84438c8832

+ 6 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CaptchaController.java

@@ -24,6 +24,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
 /**
 /**
@@ -110,10 +112,10 @@ public class CaptchaController {
 			code = captcha.getCode();
 			code = captcha.getCode();
 		}
 		}
 		redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
 		redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
-		AjaxResult ajax = AjaxResult.success();
-		ajax.put("uuid", uuid);
-		ajax.put("img", captcha.getImageBase64());
-		return ajax;
+		Map map = new HashMap<String,String>();
+		map.put("uuid", uuid);
+		map.put("img", captcha.getImageBase64());
+		return AjaxResult.success(map);
 	}
 	}
 
 
 	private String getCodeResult(String capStr) {
 	private String getCodeResult(String capStr) {