JiangChongBo 2 éve
szülő
commit
010b3b562d

+ 18 - 0
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -787,6 +787,24 @@ public class AuthProductServiceImpl implements AuthProductService {
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         List<ProductTypeListVo> productList = authProductMapper.getProductTypeList(listType, authUserId, name, status, auditStatus);
+        //如果是手机号则进行脱敏处理
+        //手机号脱敏处理(脱敏规则: 保留前三后四, 比如15638296218置换为156****6218)
+        if(null!=productList&&productList.size()>0){
+            productList.forEach(authVo -> {
+                //判断是否是手机号
+                String phoneNumber=authVo.getCreateBy();
+                if(StringUtils.isNotEmpty(phoneNumber)){
+                    boolean matches = phoneNumber.matches("^[1][3,4,5,7,8,9][0-9]{9}$");
+                    if(matches){
+                        //脱敏处理
+                        if(StringUtils.isNotEmpty(phoneNumber)){
+                            phoneNumber = phoneNumber.replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2");
+                            authVo.setCreateBy(phoneNumber);
+                        }
+                    }
+                }
+            });
+        }
         PageInfo<ProductTypeListVo> pageData = new PageInfo<>(productList);
         return ResponseJson.success(pageData);
     }

+ 8 - 6
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -153,12 +153,14 @@ public class AuthServiceImpl implements AuthService {
             authList.forEach(authVo -> {
                 //判断是否是手机号
                 String phoneNumber=authVo.getCreateBy();
-                boolean matches = phoneNumber.matches("^[1][3,4,5,7,8,9][0-9]{9}$");
-                if(matches){
-                    //脱敏处理
-                    if(StringUtils.isNotEmpty(phoneNumber)){
-                        phoneNumber = phoneNumber.replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2");
-                        authVo.setCreateBy(phoneNumber);
+                if(StringUtils.isNotEmpty(phoneNumber)){
+                    boolean matches = phoneNumber.matches("^[1][3,4,5,7,8,9][0-9]{9}$");
+                    if(matches){
+                        //脱敏处理
+                        if(StringUtils.isNotEmpty(phoneNumber)){
+                            phoneNumber = phoneNumber.replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2");
+                            authVo.setCreateBy(phoneNumber);
+                        }
                     }
                 }
             });

+ 2 - 1
src/main/java/com/caimei/service/data/impl/DatabaseServiceImpl.java

@@ -433,8 +433,9 @@ public class DatabaseServiceImpl implements DatabaseService {
                     ResponseJson.error("-1", "文件夹为空");
                 }
                 String[] filePathArr = fileTreeVo.getFilePath().split("/");
+                String file=fileTreeVo.getFilePath().substring(fileTreeVo.getFilePath().lastIndexOf("/")+1,fileTreeVo.getFilePath().length());
                 for (int i = 0; i < filePathArr.length; i++) {
-                    if (filePathArr[i].contains(".")) {
+                    if (filePathArr.length-1==i&&filePathArr[i].equals(file)) {
                         //新增文件
                         getOssUploadResult(authUserId, filePathArr[i], fileTreeVo.getOssName(), fileTreeVo.getOssUrl(), fileTreeVo.getFileSize(), fileTreeVo.getParentId(), fileTreeVo.getMime());
                         System.out.println("文件---------" + filePathArr[i]);