Browse Source

1.pom文件配置镜像

hellohaidie 6 months ago
parent
commit
8d4ede2ce7
2 changed files with 16 additions and 2 deletions
  1. 14 0
      pom.xml
  2. 2 2
      src/main/java/com/lqkj/link/module/base/service/BaseService.java

+ 14 - 0
pom.xml

@@ -18,6 +18,20 @@
18 18
         <timestamp>${maven.build.timestamp}</timestamp>
19 19
         <maven.build.timestamp.format>yyMMdd</maven.build.timestamp.format>
20 20
     </properties>
21
+    <repositories>
22
+        <repository>
23
+            <id>aliyun</id>
24
+            <url>http://192.168.4.211:8081/repository/aliyun-repository/</url>
25
+        </repository>
26
+        <repository>
27
+            <id>spring-milestones</id>
28
+            <name>Spring Milestones</name>
29
+            <url>http://192.168.4.211:8081/repository/spring-milestones</url>
30
+            <snapshots>
31
+                <enabled>false</enabled>
32
+            </snapshots>
33
+        </repository>
34
+    </repositories>
21 35
     <dependencies>
22 36
         <dependency>
23 37
             <groupId>org.springframework.boot</groupId>

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

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