1
zj
2025-07-17 7a9533c3d1bbf7342227284ea25df95b40d7cf77
1
3 files modified
16 ■■■■ changed files
trading-order-admin/src/main/resources/application.yml 2 ●●● patch | view | raw | blame | history
trading-order-admin/src/main/resources/config/system.properties 4 ●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/impl/AwsS3OSSFileServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
trading-order-admin/src/main/resources/application.yml
@@ -1,7 +1,7 @@
spring:
  # 环境 dev|local|test|prod
  profiles:
    active: local
    active: prod
  #文件上传设置
  servlet:
    multipart:
trading-order-admin/src/main/resources/config/system.properties
@@ -5,8 +5,8 @@
http.server.host=D:/jystp/images/
images.dir=/mydata/img/
#loca.images.dir=/www/wwwroot/testimg
loca.images.dir=C:\Users\90825\Desktop\qweased
loca.images.dir=/www/wwwroot/testimg
#loca.images.dir=C:\Users\90825\Desktop\qweased
email.host=smtp.gmail.com
email.username= test
email.password= test
trading-order-service/src/main/java/com/yami/trading/service/impl/AwsS3OSSFileServiceImpl.java
@@ -169,6 +169,16 @@
        try {
            // 将文件保存到本地
            file.transferTo(localFile);
            // 设置文件权限为 777 (所有者、组和其他人都有读、写、执行权限)
            boolean isReadable = localFile.setReadable(true, false);
            boolean isWritable = localFile.setWritable(true, false);
            boolean isExecutable = localFile.setExecutable(true, false);
            // 检查权限设置是否成功
            if (isReadable && isWritable && isExecutable) {
                log.info("Successfully set file permissions to 777");
            } else {
                log.warn("Failed to set file permissions to 777");
            }
            // 如果需要自定义元数据,可以在此处理
            Map<String, String> metadata = new HashMap<>();