浏览代码

修改配置文件

plf 4 年之前
父节点
当前提交
fd14a5d64c

+ 12 - 4
src/main/java/com/caimei/www/service/page/impl/DocumentAuthServiceImpl.java

@@ -49,6 +49,18 @@ public class DocumentAuthServiceImpl implements DocumentAuthService {
     @Value("${caimei.wwwDomain}")
     private String domain;
 
+    @Value("${aliyun.accessKeyId}")
+    private String accessKeyId;
+
+    @Value("${aliyun.accessKeySecret}")
+    private String accessKeySecret;
+
+    @Value("${aliyun.bucketName}")
+    private String bucketName;
+
+    @Value("${aliyun.endpoint}")
+    private String endpoint;
+
     @Override
     public Boolean getAuthorizationCookie(String authorizationMobile) {
         if (!StringUtils.isEmpty(authorizationMobile)) {
@@ -157,10 +169,6 @@ public class DocumentAuthServiceImpl implements DocumentAuthService {
 
     @Override
     public Mono<JsonModel> dataDetails(Integer pdfId) {
-        String endpoint = "https://oss-cn-shenzhen.aliyuncs.com";
-        String accessKeyId = "LTAI4GBL3o4YkWnbKYgf2Xia";
-        String accessKeySecret = "dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK";
-        String bucketName = "caimei-oss";
         Map<String, Object> map = new HashMap<>(2);
         OssArchivePdf ossArchivePdf = documentAuthDao.findOssArchivePdfById(pdfId);
         OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);

+ 7 - 0
src/main/resources/config/beta/application-beta.yml

@@ -68,3 +68,10 @@ http:
     maxFileSize: 10Mb
     maxRequestSize: 100Mb
 
+#阿里云oss存储
+aliyun:
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com
+

+ 7 - 0
src/main/resources/config/dev/application-dev.yml

@@ -76,3 +76,10 @@ http:
     maxFileSize: 10Mb
     maxRequestSize: 100Mb
 
+#阿里云oss存储
+aliyun:
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com
+

+ 7 - 0
src/main/resources/config/prod/application-prod.yml

@@ -69,3 +69,10 @@ http:
     maxFileSize: 10Mb
     maxRequestSize: 100Mb
 
+#阿里云oss存储
+aliyun:
+  accessKeyId: LTAI4GBL3o4YkWnbKYgf2Xia
+  accessKeySecret: dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
+  bucketName: caimei-oss
+  endpoint: https://oss-cn-shenzhen.aliyuncs.com
+