修复 Linux 部署问题

This commit is contained in:
昭荣伊
2019-07-01 11:57:57 +08:00
parent c721103f64
commit 03f1d18b1a
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ mysql -u root -p
```shell
# 创建库
create database app_manager;
create database app_manager DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
```
##### HTTPS 证书
@@ -56,7 +56,7 @@ create database app_manager;
#### 部署
本项目使用的是 80 和 443 端口,确保端口未被占用。
本项目使用的是 80 和 443 端口,确保端口未被占用。可以配置文件中更改为别的端口。
> 启动服务
@@ -182,7 +182,7 @@ public class PackageController {
// 生成文件名
String newFileName = UUID.randomUUID().toString() + "." + ext;
// 转存到 tmp
String destPath = FileUtils.getTempDirectory() + newFileName;
String destPath = FileUtils.getTempDirectoryPath() + File.separator + newFileName;
srcFile.transferTo(new File(destPath));
return destPath;
} catch (Exception e) {
+2 -2
View File
@@ -46,7 +46,7 @@ public class PathManager {
}
int httpPort = Integer.parseInt(environment.getProperty("server.http.port"));
int httpsPort = Integer.parseInt(environment.getProperty("server.port"));
int port = isHttps ? httpPort : httpsPort;
int port = isHttps ? httpsPort : httpPort;
String protocol = isHttps ? "https" : "http";
String portString = ":" + port;
if (port == 80 || port == 443) {
@@ -88,7 +88,7 @@ public class PathManager {
public static String getTempIconPath(Package aPackage) {
if (aPackage == null) return null;
StringBuilder path = new StringBuilder();
path.append(FileUtils.getTempDirectoryPath()).append(aPackage.getPlatform());
path.append(FileUtils.getTempDirectoryPath()).append(File.separator).append(aPackage.getPlatform());
path.append(File.separator).append(aPackage.getBundleID());
// 如果目录不存在,创建目录
File dir = new File(path.toString());
+1 -1
View File
@@ -14,7 +14,7 @@ public class ZipUtils {
public static String unzip(String path) {
try {
long start = System.currentTimeMillis();
String destDirPath = System.getProperty("java.io.tmpdir") + start;
String destDirPath = FileUtils.getTempDirectoryPath() + File.separator + start;
ZipFile zipFile = new ZipFile(path);
Enumeration<?> entries = zipFile.entries();
while (entries.hasMoreElements()) {
+1 -1
View File
@@ -1,7 +1,7 @@
########################################################
### Mysql
########################################################
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/app_manager
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/app_manager?useUnicode=true&amp;characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver