Browse Source

fixed encryption

zero 1 year ago
parent
commit
1dd8adc01d
1 changed files with 9 additions and 9 deletions
  1. 9 9
      PCS/src/main/java/cn/cslg/permission/service/LoginService.java

+ 9 - 9
PCS/src/main/java/cn/cslg/permission/service/LoginService.java

@@ -451,11 +451,11 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
      * @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 currentTimeSecond = System.currentTimeMillis() / 1000;
-        final long second = currentTimeSecond - currentTimeMillis;
+        long second = currentTimeSecond - currentTimeMillis;
         if (second > 30) {
             return Response.error(ResponseEnum.THE_REQUEST_TIME_OVERTIME);
         }
@@ -469,7 +469,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
         if (ObjectUtils.isEmpty(personnel)) {
             return Response.error(ResponseEnum.THE_TOKEN_IS_INVALID);
         }
-        final String publicKey = personnel.getPublicKey();
+        String publicKey = personnel.getPublicKey();
         List<EncryptionFunctionVO> functionVOS = 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>()
                 .in(Function::getFunctionPath, permissions));
         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::getAuthType, type));
             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();
                 functionVO.setPermission(functionPath);
                 functionVO.setEncryptionModuleCode(encryptInfo);