优化代码, 去除无用导包, 优化变量名

This commit is contained in:
zhaojun1998
2019-08-21 16:27:16 +08:00
parent 33fd0f8046
commit a5120effcc
2 changed files with 2 additions and 3 deletions

View File

@@ -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;

View File

@@ -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