|
|
@@ -16,6 +16,7 @@
|
|
|
*/
|
|
|
package org.springblade.modules.auth.endpoint;
|
|
|
|
|
|
+import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.crypto.digest.DigestUtil;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSort;
|
|
|
import com.wf.captcha.SpecCaptcha;
|
|
|
@@ -24,6 +25,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.common.cache.CacheNames;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.core.cache.utils.CacheUtil;
|
|
|
import org.springblade.core.jwt.JwtUtil;
|
|
|
import org.springblade.core.jwt.props.JwtProperties;
|
|
|
@@ -35,6 +37,7 @@ import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tenant.annotation.NonDS;
|
|
|
import org.springblade.core.tool.support.Kv;
|
|
|
+import org.springblade.core.tool.utils.AesUtil;
|
|
|
import org.springblade.core.tool.utils.DesUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.WebUtil;
|
|
|
@@ -51,6 +54,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.Assert;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.crypto.Cipher;
|
|
|
+import javax.crypto.spec.IvParameterSpec;
|
|
|
+import javax.crypto.spec.SecretKeySpec;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.time.Duration;
|
|
|
import java.util.UUID;
|
|
|
@@ -95,8 +101,14 @@ public class BladeTokenEndPoint {
|
|
|
if (username != null && password != null){
|
|
|
|
|
|
boolean isLdapuser = userService.isLdapUserByAccount(username);
|
|
|
- // cyzh2020 对应前端加密的key
|
|
|
- String decryptFormHex = DesUtil.decryptFormHex(password, "cyzh2020");
|
|
|
+ String decryptFormHex = null;
|
|
|
+// String decryptFormHex = DesUtil.decryptFormHex(password, "cyzh2020");
|
|
|
+ try {
|
|
|
+ decryptFormHex = CommonUtil.myAesDecrypt(password);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
if (isLdapuser){
|
|
|
// 该用户为ldap类型
|
|
|
if (ldapOpen != null && "true".equals(ldapOpen)){
|
|
|
@@ -132,7 +144,6 @@ public class BladeTokenEndPoint {
|
|
|
return TokenUtil.createAuthInfo(userInfo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@GetMapping("/oauth/logout")
|
|
|
@ApiOperation(value = "退出登录")
|
|
|
public Kv logout() {
|