mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
⚡ 优化代码, 去除无用导包, 优化变量名
This commit is contained in:
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -72,12 +72,12 @@ public class LocalService implements FileService {
|
||||
// 网络协议
|
||||
String networkProtocol = request.getScheme();
|
||||
// 网络ip
|
||||
String ip = request.getServerName();
|
||||
String host = request.getServerName();
|
||||
// 端口号
|
||||
int port = request.getServerPort();
|
||||
// 项目发布名称
|
||||
String webApp = request.getContextPath();
|
||||
return StringUtils.concatDomainAndPath(networkProtocol + "://" + ip + ":" + port + webApp, "local-download?fileName=" + path);
|
||||
return StringUtils.concatDomainAndPath(networkProtocol + "://" + host + ":" + port + webApp, "local-download?fileName=" + path);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user