|
|
@@ -10,26 +10,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.jzg.commons.annotation.IgnoreTenant;
|
|
|
import com.jzg.commons.constants.EncryptionConstants;
|
|
|
+import com.jzg.commons.constants.RedisKeyConstants;
|
|
|
+import com.jzg.commons.core.base.BaseController;
|
|
|
+import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.po.SysUserJzgApp;
|
|
|
+import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.commons.request.RequestSingleParam;
|
|
|
import com.jzg.commons.util.AssertionUtils;
|
|
|
+import com.jzg.commons.util.ImageUtil;
|
|
|
import com.jzg.commons.util.MinioUtils;
|
|
|
import com.jzg.commons.util.PasswordUtils;
|
|
|
import com.jzg.config.JzgTokenService;
|
|
|
import com.jzg.config.JzgUsernamePasswordAuthenticationToken;
|
|
|
-import com.jzg.commons.constants.RedisKeyConstants;
|
|
|
-import com.jzg.commons.core.base.BaseController;
|
|
|
-import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.entity.RedisToken;
|
|
|
import com.jzg.entity.SysUploadFiles;
|
|
|
import com.jzg.entity.SysUser;
|
|
|
import com.jzg.entity.vo.*;
|
|
|
-import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.handler.JzgAuthenticationSuccessHandler;
|
|
|
import com.jzg.mapper.SysUploadFilesMapper;
|
|
|
import com.jzg.mapper.SysUserJzgAppMapper;
|
|
|
+import com.jzg.mapper.SysUserJzgInfoMapper;
|
|
|
import com.jzg.service.SysUserService;
|
|
|
-import com.jzg.commons.util.ImageUtil;
|
|
|
import com.wf.captcha.SpecCaptcha;
|
|
|
import com.wf.captcha.base.Captcha;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
@@ -56,7 +57,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
import javax.imageio.ImageIO;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.IOException;
|
|
|
-import java.security.*;
|
|
|
+import java.security.InvalidAlgorithmParameterException;
|
|
|
+import java.security.NoSuchAlgorithmException;
|
|
|
+import java.security.NoSuchProviderException;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
@@ -102,6 +105,9 @@ public class AuthController extends BaseController {
|
|
|
@Autowired
|
|
|
private SysUserJzgAppMapper sysUserJzgAppMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserJzgInfoMapper sysUserJzgInfoMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 登录接口
|
|
|
*
|
|
|
@@ -132,7 +138,7 @@ public class AuthController extends BaseController {
|
|
|
JzgUsernamePasswordAuthenticationToken authentication = new JzgUsernamePasswordAuthenticationToken(loginFormVo);
|
|
|
Authentication authenticate = authenticationManager.authenticate(authentication);
|
|
|
SecurityContextHolder.getContext().setAuthentication(authenticate);
|
|
|
- JzgAuthenticationSuccessHandler successHandler = new JzgAuthenticationSuccessHandler(tokenStore);
|
|
|
+ JzgAuthenticationSuccessHandler successHandler = new JzgAuthenticationSuccessHandler(tokenStore, sysUserJzgInfoMapper);
|
|
|
successHandler.onAuthenticationSuccess(request, response, authenticate);
|
|
|
}
|
|
|
|
|
|
@@ -421,7 +427,7 @@ public class AuthController extends BaseController {
|
|
|
SM2 sm2 = SmUtil.sm2();
|
|
|
String sm2PrivateKeyHex = HexUtil.encodeHexStr(BCUtil.encodeECPrivateKey(sm2.getPrivateKey()));
|
|
|
if (sm2PrivateKeyHex.length() > 64) {
|
|
|
- sm2PrivateKeyHex = sm2PrivateKeyHex.substring(2, sm2PrivateKeyHex.length());
|
|
|
+ sm2PrivateKeyHex = sm2PrivateKeyHex.substring(2);
|
|
|
}
|
|
|
String sm2PublicKeyHex = HexUtil.encodeHexStr(((BCECPublicKey) sm2.getPublicKey()).getQ().getEncoded(false));
|
|
|
jsonObject.put("javaSm2PrivateKey", sm2PrivateKeyHex);
|