|
@@ -1,32 +1,28 @@
|
|
|
-package com.ym.mec.auth.web.controller;
|
|
|
+package com.ym.mec.student.controller;
|
|
|
|
|
|
+import com.google.code.kaptcha.Constants;
|
|
|
+import com.google.code.kaptcha.Producer;
|
|
|
+import com.google.code.kaptcha.servlet.KaptchaServlet;
|
|
|
+import com.ym.mec.biz.service.SmsCodeService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.security.SecurityConstants;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-import java.awt.image.BufferedImage;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-
|
|
|
-import javax.imageio.ImageIO;
|
|
|
-import javax.servlet.ServletOutputStream;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import com.google.code.kaptcha.Constants;
|
|
|
-import com.google.code.kaptcha.Producer;
|
|
|
-import com.google.code.kaptcha.servlet.KaptchaServlet;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
-import com.ym.mec.common.security.SecurityConstants;
|
|
|
-import com.ym.mec.common.validcode.SmsCodeService;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("code")
|
|
@@ -42,7 +38,7 @@ public class SmsCodeController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "发送登录短信验证码")
|
|
|
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String")
|
|
|
- @PostMapping(value = "/sendSms",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
+ @PostMapping(value = "/sendSms")
|
|
|
public Object sendLoginVerifyCode(String mobile) throws Exception {
|
|
|
smsCodeService.sendValidCode(mobile);
|
|
|
return succeed();
|
|
@@ -51,7 +47,7 @@ public class SmsCodeController extends BaseController {
|
|
|
@ApiOperation(value = "校验短信验证码")
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
|
|
|
@ApiImplicitParam(name = "code", value = "短信验证码", required = true, dataType = "String") })
|
|
|
- @PostMapping(value = "/verifySmsCode",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
+ @PostMapping(value = "/verifySmsCode")
|
|
|
public Object verifySmsCode(String phone,String code) {
|
|
|
if(StringUtils.isEmpty(phone) || StringUtils.isEmpty(code)){
|
|
|
return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
|
|
@@ -62,7 +58,7 @@ public class SmsCodeController extends BaseController {
|
|
|
return failed();
|
|
|
}
|
|
|
|
|
|
- @PostMapping(value = "/verifyLoginImage",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
+ @PostMapping(value = "/verifyLoginImage")
|
|
|
@ApiOperation("校验登录图形验证码")
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
|
|
|
@ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
|