Browse Source

验证码使用jsonp方式

gt 3 years ago
parent
commit
1f7214277d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/main/java/com/jd/zfjyjgfwpt/controller/FrontController.java

+ 4 - 4
src/main/java/com/jd/zfjyjgfwpt/controller/FrontController.java

@@ -278,20 +278,20 @@ public class FrontController extends BaseController {
      * @param FYHYM 房源核验码
      */
     @GetMapping("houseSourceVerify")
-    public void houseSourceVerify(String FYHYM, String captcha) {
+    public void houseSourceVerify(String callback, String FYHYM, String captcha) {
         if (Blank.isEmpty(FYHYM, captcha)) {
-            sendJson(false, "房源核验码或验证码不能为空!", null);
+            sendJsonp(callback, false, "房源核验码或验证码不能为空!", null);
             return;
         }
 
         String saveCaptcha = Convert.toStr(redisTemplate.opsForValue().get(getRequest().getRequestedSessionId() + "-captcha"), "");
         if ("".equals(saveCaptcha) || !captcha.equals(saveCaptcha)) {
-            sendJson(false, "输入的验证码有误!", null);
+            sendJsonp(callback, false, "输入的验证码有误!", null);
             return;
         }
 
         final ApiResponse<?> apiResponse = service.houseSourceVerify(FYHYM);
-        sendJson(apiResponse.isSuccess(), apiResponse.getMsg(), apiResponse.getData());
+        sendJsonp(callback, apiResponse.isSuccess(), apiResponse.getMsg(), apiResponse.getData());
     }
 
     /**