|
|
|
@@ -50,7 +50,7 @@ public class HomeController { |
|
|
|
@Autowired |
|
|
|
private MallRolePermissionService mallRolePermissionService; |
|
|
|
|
|
|
|
@RequestMapping("/captcha.jpg") |
|
|
|
@GetMapping("/captcha.jpg") |
|
|
|
public void captcha(HttpServletResponse response)throws ServletException, IOException { |
|
|
|
response.setHeader("Cache-Control", "no-store, no-cache"); |
|
|
|
response.setContentType("image/jpeg"); |
|
|
|
@@ -69,12 +69,10 @@ public class HomeController { |
|
|
|
|
|
|
|
@ApiOperation("登录") |
|
|
|
@PostMapping("/doLogin") |
|
|
|
public ResultData login(@RequestBody MallUserInfo user, String captcha) { |
|
|
|
if (captcha != null) { |
|
|
|
String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY); |
|
|
|
if(!captcha.equalsIgnoreCase(kaptcha)){ |
|
|
|
return new ResultData(ErrorCode.KAPCHA_NOT_EQUAL); |
|
|
|
} |
|
|
|
public ResultData login(@RequestBody MallUserInfo user) { |
|
|
|
String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY); |
|
|
|
if(!user.getCaptcha().equalsIgnoreCase(kaptcha)){ |
|
|
|
return new ResultData(ErrorCode.KAPCHA_NOT_EQUAL); |
|
|
|
} |
|
|
|
|
|
|
|
ResultData data = new ResultData(); |
|
|
|
|