Commit 050c0d71 authored by 董天德's avatar 董天德

Merge remote-tracking branch 'origin/dev_20230307_login_mq' into dev_ch_master

parents 9adf0859 9d7d1c65
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.controller;
import com.alibaba.fastjson.JSONObject;
import com.hungraim.ltc.util.CsoftSecurityUtil;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -24,6 +25,8 @@ import java.util.Map;
@AllArgsConstructor
public class AuthController {
final static String FALSE="false";
private final RedisTemplate redisTemplate;
private final TokenEndpoint tokenEndpoint;
......@@ -31,6 +34,9 @@ public class AuthController {
@SneakyThrows
public Result<OAuth2AccessToken> postAccessToken(Principal principal, @RequestParam Map<String, String> parameters) {
String password = parameters.get("password");
if(FALSE.equals(password)){
return Result.failed(ResultCode.USER_LOGIN_ERROR);
}
String decrypt = CsoftSecurityUtil.decryptRSADefault(password);
parameters.put("password", decrypt);
OAuth2AccessToken oAuth2AccessToken = tokenEndpoint.postAccessToken(principal, parameters).getBody();
......
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