forked from kidgrow-microservices-platform

houruijun
2020-08-13 ac8623cb19965acc0f8fb021257ceaf5d0000b82
kidgrow-uaa/kidgrow-uaa-server/src/main/java/com/kidgrow/oauth2/controller/OAuth2Controller.java
@@ -6,6 +6,7 @@
import com.kidgrow.authclient.util.AuthUtils;
import com.kidgrow.common.constant.SecurityConstants;
import com.kidgrow.common.context.ClientContextHolder;
import com.kidgrow.common.utils.AesUtils;
import com.kidgrow.common.utils.ResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -62,8 +63,12 @@
    public void getUserTokenInfo(
            @ApiParam(required = true, name = "username", value = "账号") String username,
            @ApiParam(required = true, name = "password", value = "密码") String password,
            HttpServletRequest request, HttpServletResponse response) throws IOException {
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
            HttpServletRequest request, HttpServletResponse response) throws Exception {
        //先解密
        String decryptName = AesUtils.desEncrypt(username).trim();
        String decryptPwd = AesUtils.desEncrypt(password).trim();
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(decryptName, decryptPwd);
        writerToken(request, response, token, "用户名或密码错误");
    }