xiongzhu %!s(int64=4) %!d(string=hai) anos
pai
achega
880eb24c88

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

@@ -24,6 +24,9 @@ public class LocalStorageService implements StorageService {
     @Value("${storage.local_path}")
     private String localPath;
 
+    @Value("${general.host}")
+    private String host;
+
     @Override
     public String uploadFromInputStream(InputStream fin, String path) {
         log.info("本地上传: inputStream -> {}", path);
@@ -58,6 +61,6 @@ public class LocalStorageService implements StorageService {
         } catch (IOException e) {
             e.printStackTrace();
         }
-        return "files" + "/" + path;
+        return host + "/files" + "/" + path;
     }
 }

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

@@ -93,7 +93,7 @@ ezviz:
     app_id: 7851448260f84d6a83585adfff7301d8
     app_secret: 7bd9a092d6ae0f373e9168d85d238efe
 general:
-    host: http://wlj.izouma.com
+    host: http://yskj.njlyw.cn:8081
 ---
 
 spring:
@@ -103,5 +103,10 @@ spring:
 
 spring:
     profiles: prod
-    url: jdbc:mysql://mysql.izouma.com/exam?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
-
+    datasource:
+        url: jdbc:mysql://localhost/exam?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
+        username: root
+        password: "#di95iwZaVg%Nzx@"
+storage:
+    provider: local
+    local_path: /var/www/upload/