Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Jul 1, 2022
1 parent 5c4bb57 commit 43e865e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ services:
- SONIC_EUREKA_PASSWORD
- SONIC_EUREKA_HOST=sonic-server-eureka
- SONIC_EUREKA_PORT
- SONIC_SERVER_HOST
- SONIC_SERVER_PORT
- SECRET_KEY
- EXPIRE_DAY
networks:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ services:
- SONIC_EUREKA_PASSWORD
- SONIC_EUREKA_HOST=sonic-server-eureka
- SONIC_EUREKA_PORT
- SONIC_SERVER_HOST
- SONIC_SERVER_PORT
- SECRET_KEY
- EXPIRE_DAY
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ spring:
servlet:
multipart:
maxFileSize: -1
maxRequestSize: -1
maxRequestSize: -1

# 网关的IP地址
gateway:
host: http://${SONIC_SERVER_HOST:localhost}:${SONIC_SERVER_PORT:3000}/server
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
@RefreshScope
public class FileTool {
private final Logger logger = LoggerFactory.getLogger(FileTool.class);
@Value("${gateway.host}")
private String host;

/**
* @param folderName 文件夹
Expand All @@ -66,7 +68,8 @@ public String upload(String folderName, MultipartFile file) throws IOException {
} catch (FileAlreadyExistsException e) {
logger.error(e.getMessage());
}
return "/folder/" + local.getPath().replaceAll("\\\\", "/");
host = host.replace(":80/", "/");
return host + "/api/folder/" + local.getPath().replaceAll("\\\\", "/");
}

/**
Expand Down Expand Up @@ -158,6 +161,7 @@ public String merge(String uuid, String fileName, int totalCount) {
} catch (IOException e) {
logger.error(e.getMessage());
}
return "/folder/" + file.getPath();
host = host.replace(":80/", "/");
return host + "/api/folder/" + file.getPath();
}
}

0 comments on commit 43e865e

Please sign in to comment.