소스 검색

MOD: captcha rest controller

guoyc 8 년 전
부모
커밋
6a9fae119d
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/ctrl/CaptchaController.java

+ 3 - 4
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/ctrl/CaptchaController.java

@@ -7,10 +7,10 @@ import cn.iselab.mooctest.site.web.constants.CookieConsts;
 import cn.iselab.mooctest.site.web.logic.VerificationLogic;
 import com.google.code.kaptcha.impl.DefaultKaptcha;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.imageio.ImageIO;
@@ -24,7 +24,7 @@ import java.awt.image.BufferedImage;
  * @author sean
  * @date 2017-03-21.
  */
-@Controller
+@RestController
 public class CaptchaController extends BaseController {
 
     @Autowired
@@ -66,9 +66,8 @@ public class CaptchaController extends BaseController {
     }
 
     @RequestMapping(value = UrlConstants.API_COMMON + "captcha/mobile/{mobile:\\d+}", method = RequestMethod.POST)
-    public boolean sendMobileCaptcha(@PathVariable("mobile") String mobile) {
+    public void sendMobileCaptcha(@PathVariable("mobile") String mobile) {
         verificationLogic.sendMobileVerfication(mobile);
-        return true;
     }
 
 }