Browse Source

Merge branch 'feature/v1.0.0.0/lyt/fixbug' of http://192.168.4.240:3000/LINK/LINK-SERVER into release/V1.0.0/test

liaoyitao 3 months ago
parent
commit
0ca0a575b0

+ 3 - 0
.gitignore

@@ -32,3 +32,6 @@ build/
32
 ### VS Code ###
32
 ### VS Code ###
33
 .vscode/
33
 .vscode/
34
 /config/application.yml
34
 /config/application.yml
35
+/log/*.log
36
+log
37
+log/

+ 2 - 1
src/main/java/com/lqkj/link/module/base/service/BaseService.java

@@ -45,8 +45,9 @@ public class BaseService {
45
     public MessageBean<String> uploadModelCompress(MultipartFile file, String path) {
45
     public MessageBean<String> uploadModelCompress(MultipartFile file, String path) {
46
         String fileName = file.getOriginalFilename();
46
         String fileName = file.getOriginalFilename();
47
         String suffix = fileName == null ? "" : fileName.substring(fileName.lastIndexOf(".") + 1);
47
         String suffix = fileName == null ? "" : fileName.substring(fileName.lastIndexOf(".") + 1);
48
-        if (!suffix.equals("zip"))
48
+        if (!suffix.equals("zip") || !suffix.equals("rar")) {
49
             return MessageBean.error("上传文件类型必须是zip、rar格式的模型文件");
49
             return MessageBean.error("上传文件类型必须是zip、rar格式的模型文件");
50
+        }
50
         String newFileName = UUID.randomUUID() + "." + suffix;
51
         String newFileName = UUID.randomUUID() + "." + suffix;
51
         String filePath = "./upload/" + path;
52
         String filePath = "./upload/" + path;
52
         FileUtils.saveFile(file, filePath, newFileName);
53
         FileUtils.saveFile(file, filePath, newFileName);

+ 3 - 0
src/main/java/com/lqkj/link/module/jwt/controller/JwtController.java

@@ -59,6 +59,9 @@ public class JwtController {
59
         if (userInfo == null) {
59
         if (userInfo == null) {
60
             return MessageBean.error("账号不存在!");
60
             return MessageBean.error("账号不存在!");
61
         }
61
         }
62
+        if (!userInfo.getHasManage()){
63
+            return MessageBean.error("账号无权限,请联系管理员!");
64
+        }
62
         if (userDetailService.isLocked(userInfo.getUserCode())) {//账号是否被冻结
65
         if (userDetailService.isLocked(userInfo.getUserCode())) {//账号是否被冻结
63
             return MessageBean.error("账号已被冻结,请稍后重试!");
66
             return MessageBean.error("账号已被冻结,请稍后重试!");
64
         }
67
         }

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/repository/ZoneInfoRepository.java

@@ -124,7 +124,7 @@ public interface ZoneInfoRepository extends JpaRepository<ZoneInfo, Integer> {
124
                      @Param("userCode") String userCode);
124
                      @Param("userCode") String userCode);
125
 
125
 
126
     @Query(nativeQuery = true,
126
     @Query(nativeQuery = true,
127
-        value = "select auth_status != 1 from zone_info where zone_id = :zoneId"
127
+        value = "select auth_status = 1 or auth_status = 2 from zone_info where zone_id = :zoneId"
128
     )
128
     )
129
     Boolean canBeDeleteWithAuthStatus(@Param("zoneId") Integer zoneId);
129
     Boolean canBeDeleteWithAuthStatus(@Param("zoneId") Integer zoneId);
130
 
130
 

+ 4 - 1
src/main/java/com/lqkj/link/module/zone/service/ZoneInfoService.java

@@ -274,10 +274,13 @@ public class ZoneInfoService {
274
     }
274
     }
275
 
275
 
276
     public String deleteWork(Integer zoneId, String userCode) {
276
     public String deleteWork(Integer zoneId, String userCode) {
277
+        if(!zoneInfoRepository.existsById(zoneId)){
278
+            return "该作品不存在!";
279
+        }
277
         if (!zoneInfoRepository.isAuthor(zoneId, userCode)) {
280
         if (!zoneInfoRepository.isAuthor(zoneId, userCode)) {
278
             return "您不是该作品的作者!";
281
             return "您不是该作品的作者!";
279
         }
282
         }
280
-        if (!zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
283
+        if (zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
281
             return "不能删除正在审核或已发布的作品!";
284
             return "不能删除正在审核或已发布的作品!";
282
         }
285
         }
283
         zoneInfoRepository.deleteById(zoneId);
286
         zoneInfoRepository.deleteById(zoneId);