xiongzhu 4 년 전
부모
커밋
54089f2650

+ 3 - 1
.gitignore

@@ -33,4 +33,6 @@ build/
 .DS_Store
 
 dump.sql
-build.tar.gz
+build.tar.gz
+
+/upload

+ 1 - 0
src/main/java/com/izouma/jmrh/security/WebSecurityConfig.java

@@ -102,6 +102,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/category/all").permitAll()
                 .antMatchers("/threshold/getOneThreshold").permitAll()
                 .antMatchers("/sysConfig/get/*").permitAll()
+                .antMatchers("/files/**").permitAll()
 
 
                 // all other requests need to be authenticated

+ 1 - 1
src/main/java/com/izouma/jmrh/service/storage/LocalStorageService.java

@@ -58,6 +58,6 @@ public class LocalStorageService implements StorageService {
         } catch (IOException e) {
             e.printStackTrace();
         }
-        return "files" + "/" + path;
+        return "/files" + "/" + path;
     }
 }

+ 17 - 3
src/main/resources/application.yaml

@@ -65,8 +65,8 @@ wx:
     notifyUrl: http://zmj.izouma.com/wx/payNotify
     refundNotifyUrl: http://zmj.izouma.com/wx/refundNotify
 storage:
-  provider: aliyun
-  local_path: /var/www/upload/
+  provider: local
+  local_path: /Users/drew/Projects/Java/jmrh/upload/
 aliyun:
   access-key-id: PXzJyah5rZfWHIIH
   access-key-secret: e1MS6j0wypXJrw8CM0hObZu8qKbfah
@@ -94,14 +94,21 @@ spring:
     url: jdbc:mysql://mysql.izouma.com/jmrh?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
     username: microball
     password: 2wsx@WSX#EDC
+storage:
+  provider: local
+  local_path: /var/www/upload/
 
 ---
+
 spring:
   profiles: prod1
   datasource:
     url: jdbc:mysql://10.4.115.11/jmrh?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8
     username: root
     password: 8mGb6*wBMs$#3Hak
+storage:
+  provider: local
+  local_path: /var/www/upload/
 
 ---
 
@@ -111,11 +118,18 @@ spring:
     url: jdbc:mysql://10.5.23.169/jmrh?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8
     username: root
     password: 8mGb6*wBMs$#3Hak
+storage:
+  provider: local
+  local_path: /var/www/upload/
 
 ---
+
 spring:
   profiles: prod3
   datasource:
     url: jdbc:mysql://10.5.23.173/jmrh?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8
     username: root
-    password: 8mGb6*wBMs$#3Hak
+    password: 8mGb6*wBMs$#3Hak
+storage:
+  provider: local
+  local_path: /var/www/upload/