修改前端的验证码和登录相关的接口
This commit is contained in:
@ -47,16 +47,16 @@ public class CaptchaController
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult<Captcha> getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
AjaxResult<Captcha> ajax = AjaxResult.success();
|
||||
Captcha captcha = new Captcha();
|
||||
AjaxResult<Captcha> ajax = AjaxResult.success(captcha);
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
if (!captchaEnabled)
|
||||
{
|
||||
|
||||
captcha.setCaptchaEnabled(captchaEnabled);
|
||||
|
||||
return ajax;
|
||||
}
|
||||
captcha.setCaptchaEnabled(captchaEnabled);
|
||||
// if (captchaEnabled)
|
||||
// {
|
||||
//
|
||||
// }else {
|
||||
// captcha.setCaptchaEnabled(captchaEnabled);
|
||||
// }
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
@ -94,6 +94,7 @@ public class CaptchaController
|
||||
|
||||
captcha.setUuid(uuid);
|
||||
captcha.setImg(Base64.encode(os.toByteArray()));
|
||||
ajax.setData(captcha);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
@ -56,14 +56,14 @@ public class SysLoginController
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
public AjaxResult<String> login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
|
||||
return AjaxResult.success(token);
|
||||
return AjaxResult.success("操作成功",token);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user