change - 修改登录接口

master
yinq 10 months ago
parent ba5932e560
commit 11ca444308

@ -40,13 +40,29 @@ public class SysLoginController
private ISysPostService postService; private ISysPostService postService;
/** /**
* * PDA
* *
* @param loginBody * @param loginBody
* @return * @return
*/ */
@PostMapping("/login") @PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody) public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), "PDA_VALIDATE", loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
*
*
* @param loginBody
* @return
*/
@PostMapping("/indexLogin")
public AjaxResult indexLogin(@RequestBody LoginBody loginBody)
{ {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// 生成令牌 // 生成令牌

@ -64,7 +64,9 @@ public class SysLoginService
public String login(String username, String password, String code, String uuid) public String login(String username, String password, String code, String uuid)
{ {
// 验证码校验 // 验证码校验
validateCaptcha(username, code, uuid); if (StringUtils.isNotEmpty(code) && !code.equals("PDA_VALIDATE")){
validateCaptcha(username, code, uuid);
}
// 登录前置校验 // 登录前置校验
loginPreCheck(username, password); loginPreCheck(username, password);
// 用户验证 // 用户验证

Loading…
Cancel
Save