Commit e98523f8 authored by shiyu's avatar shiyu

auth

parent 9c260a30
......@@ -11,6 +11,8 @@ import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import com.wwdz.ch.admin.entity.request.LoginRequestDto;
import com.xxdxxs.utils.JsonUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.LockedAccountException;
......@@ -60,13 +62,13 @@ public class AdminAuthController {
* { username : value, password : value }
*/
@PostMapping("/login")
public Object login(@RequestBody String body) {
logger.info("【请求开始】系统管理->用户登录,请求参数:body:{}", body);
public Object login(@RequestBody LoginRequestDto loginRequestDto) {
logger.info("【请求开始】系统管理->用户登录,请求参数:body:{}", JsonUtils.from(loginRequestDto));
String username = JacksonUtil.parseString(body, "username");
String password = JacksonUtil.parseString(body, "password");
String code = JacksonUtil.parseString(body, "code");
String uuid = JacksonUtil.parseString(body, "uuid");
String username = loginRequestDto.getUsername();
String password = loginRequestDto.getPassword();
String code = loginRequestDto.getCode();
String uuid = loginRequestDto.getUuid();
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password) || StringUtils.isEmpty(code) || StringUtils.isEmpty(uuid)) {
return ResponseUtil.badArgument();
......
package com.wwdz.ch.admin.entity.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
@Data
public class LoginRequestDto implements Entity {
private String username;
private String password;
private String code;
private String uuid;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment