|
@@ -455,6 +455,10 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
public String functionByEncryption(EncryptionFunctionDTO vo) throws Exception {
|
|
public String functionByEncryption(EncryptionFunctionDTO vo) throws Exception {
|
|
String sign = vo.getSign();
|
|
String sign = vo.getSign();
|
|
String appKey = vo.getAppKey();
|
|
String appKey = vo.getAppKey();
|
|
|
|
+ String version = vo.getVersion();
|
|
|
|
+ if (Boolean.TRUE.equals(StringUtils.isEmpty(version))){
|
|
|
|
+ return Response.error(ResponseEnum.THE_VERSION_IS_NULL);
|
|
|
|
+ }
|
|
long currentTimeMillis = vo.getCurrentTimeMillis() / 1000;
|
|
long currentTimeMillis = vo.getCurrentTimeMillis() / 1000;
|
|
long currentTimeSecond = System.currentTimeMillis() / 1000;
|
|
long currentTimeSecond = System.currentTimeMillis() / 1000;
|
|
long second = currentTimeSecond - currentTimeMillis;
|
|
long second = currentTimeSecond - currentTimeMillis;
|
|
@@ -487,7 +491,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
permissions.add(i.getFunctionPath());
|
|
permissions.add(i.getFunctionPath());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- List<EncryptionFunctionVO> list = this.loadFunctionVOS(permissions, 2, symmetryKey);
|
|
|
|
|
|
+ List<EncryptionFunctionVO> list = this.loadFunctionVOS(permissions, 2, symmetryKey,version);
|
|
functionVOS.addAll(list);
|
|
functionVOS.addAll(list);
|
|
|
|
|
|
List<String> permissions1 = new ArrayList<>();
|
|
List<String> permissions1 = new ArrayList<>();
|
|
@@ -498,7 +502,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
permissions1.add(i.getFunctionPath());
|
|
permissions1.add(i.getFunctionPath());
|
|
});
|
|
});
|
|
permissions1.removeAll(permissions);
|
|
permissions1.removeAll(permissions);
|
|
- List<EncryptionFunctionVO> list1 = this.loadFunctionVOS(permissions1, 1, symmetryKey);
|
|
|
|
|
|
+ List<EncryptionFunctionVO> list1 = this.loadFunctionVOS(permissions1, 1, symmetryKey,version);
|
|
functionVOS.addAll(list1);
|
|
functionVOS.addAll(list1);
|
|
finalVO.setFunctionVOS(functionVOS);
|
|
finalVO.setFunctionVOS(functionVOS);
|
|
String key = RSAUtils.encryptByPublicKey(symmetryKey, publicKey);
|
|
String key = RSAUtils.encryptByPublicKey(symmetryKey, publicKey);
|
|
@@ -506,7 +510,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
return Response.success(finalVO);
|
|
return Response.success(finalVO);
|
|
}
|
|
}
|
|
|
|
|
|
- private List<EncryptionFunctionVO> loadFunctionVOS(List<String> permissions, Integer type, String symmetryKey) throws Exception {
|
|
|
|
|
|
+ private List<EncryptionFunctionVO> loadFunctionVOS(List<String> permissions, Integer type, String symmetryKey, String version) throws Exception {
|
|
List<EncryptionFunctionVO> functionVOS = new ArrayList<>();
|
|
List<EncryptionFunctionVO> functionVOS = new ArrayList<>();
|
|
List<Function> functions = functionMapper.selectList(new LambdaQueryWrapper<Function>()
|
|
List<Function> functions = functionMapper.selectList(new LambdaQueryWrapper<Function>()
|
|
.in(Function::getFunctionPath, permissions));
|
|
.in(Function::getFunctionPath, permissions));
|
|
@@ -515,7 +519,8 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
|
|
String functionPath = function.getFunctionPath();
|
|
String functionPath = function.getFunctionPath();
|
|
AssoFunctionModule functionModule = assoFunctionModuleMapper.selectOne(new LambdaQueryWrapper<AssoFunctionModule>()
|
|
AssoFunctionModule functionModule = assoFunctionModuleMapper.selectOne(new LambdaQueryWrapper<AssoFunctionModule>()
|
|
.eq(AssoFunctionModule::getFunctionId, functionId)
|
|
.eq(AssoFunctionModule::getFunctionId, functionId)
|
|
- .eq(AssoFunctionModule::getAuthType, type));
|
|
|
|
|
|
+ .eq(AssoFunctionModule::getAuthType, type)
|
|
|
|
+ .eq(AssoFunctionModule::getVersion, version));
|
|
if (ObjectUtils.isNotEmpty(functionModule) && StringUtils.isNotEmpty(functionModule.getCode())) {
|
|
if (ObjectUtils.isNotEmpty(functionModule) && StringUtils.isNotEmpty(functionModule.getCode())) {
|
|
String moduleCode = functionModule.getCode();
|
|
String moduleCode = functionModule.getCode();
|
|
String encryptInfo = AESUtils.encrypt(moduleCode, symmetryKey);
|
|
String encryptInfo = AESUtils.encrypt(moduleCode, symmetryKey);
|