|
@@ -451,11 +451,11 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String functionByEncryption(EncryptionFunctionDTO vo) throws Exception {
|
|
public String functionByEncryption(EncryptionFunctionDTO vo) throws Exception {
|
|
- final String sign = vo.getSign();
|
|
|
|
- final String appKey = vo.getAppKey();
|
|
|
|
|
|
+ String sign = vo.getSign();
|
|
|
|
+ String appKey = vo.getAppKey();
|
|
long currentTimeMillis = vo.getCurrentTimeMillis() / 1000;
|
|
long currentTimeMillis = vo.getCurrentTimeMillis() / 1000;
|
|
long currentTimeSecond = System.currentTimeMillis() / 1000;
|
|
long currentTimeSecond = System.currentTimeMillis() / 1000;
|
|
- final long second = currentTimeSecond - currentTimeMillis;
|
|
|
|
|
|
+ long second = currentTimeSecond - currentTimeMillis;
|
|
if (second > 30) {
|
|
if (second > 30) {
|
|
return Response.error(ResponseEnum.THE_REQUEST_TIME_OVERTIME);
|
|
return Response.error(ResponseEnum.THE_REQUEST_TIME_OVERTIME);
|
|
}
|
|
}
|
|
@@ -469,7 +469,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
if (ObjectUtils.isEmpty(personnel)) {
|
|
if (ObjectUtils.isEmpty(personnel)) {
|
|
return Response.error(ResponseEnum.THE_TOKEN_IS_INVALID);
|
|
return Response.error(ResponseEnum.THE_TOKEN_IS_INVALID);
|
|
}
|
|
}
|
|
- final String publicKey = personnel.getPublicKey();
|
|
|
|
|
|
+ String publicKey = personnel.getPublicKey();
|
|
List<EncryptionFunctionVO> functionVOS = new ArrayList<>();
|
|
List<EncryptionFunctionVO> functionVOS = new ArrayList<>();
|
|
|
|
|
|
List<String> permissions = new ArrayList<>();
|
|
List<String> permissions = new ArrayList<>();
|
|
@@ -504,14 +504,14 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
List<Function> functions = functionMapper.selectList(new LambdaQueryWrapper<Function>()
|
|
List<Function> functions = functionMapper.selectList(new LambdaQueryWrapper<Function>()
|
|
.in(Function::getFunctionPath, permissions));
|
|
.in(Function::getFunctionPath, permissions));
|
|
for (Function function : functions) {
|
|
for (Function function : functions) {
|
|
- final Integer functionId = function.getId();
|
|
|
|
- final String functionPath = function.getFunctionPath();
|
|
|
|
- final AssoFunctionModule functionModule = assoFunctionModuleMapper.selectOne(new LambdaQueryWrapper<AssoFunctionModule>()
|
|
|
|
|
|
+ Integer functionId = function.getId();
|
|
|
|
+ String functionPath = function.getFunctionPath();
|
|
|
|
+ AssoFunctionModule functionModule = assoFunctionModuleMapper.selectOne(new LambdaQueryWrapper<AssoFunctionModule>()
|
|
.eq(AssoFunctionModule::getFunctionId, functionId)
|
|
.eq(AssoFunctionModule::getFunctionId, functionId)
|
|
.eq(AssoFunctionModule::getAuthType, type));
|
|
.eq(AssoFunctionModule::getAuthType, type));
|
|
if (ObjectUtils.isNotEmpty(functionModule) && StringUtils.isNotEmpty(functionModule.getCode())) {
|
|
if (ObjectUtils.isNotEmpty(functionModule) && StringUtils.isNotEmpty(functionModule.getCode())) {
|
|
- final String moduleCode = functionModule.getCode();
|
|
|
|
- final String encryptInfo = RSAUtils.encryptByPublicKey(moduleCode, publicKey);
|
|
|
|
|
|
+ String moduleCode = functionModule.getCode();
|
|
|
|
+ String encryptInfo = RSAUtils.encryptByPublicKey(moduleCode, publicKey);
|
|
EncryptionFunctionVO functionVO = new EncryptionFunctionVO();
|
|
EncryptionFunctionVO functionVO = new EncryptionFunctionVO();
|
|
functionVO.setPermission(functionPath);
|
|
functionVO.setPermission(functionPath);
|
|
functionVO.setEncryptionModuleCode(encryptInfo);
|
|
functionVO.setEncryptionModuleCode(encryptInfo);
|