添加mac

This commit is contained in:
jiangzeyin 2019-04-28 22:17:47 +08:00
parent ec0799a4d4
commit 0a9286a506
5 changed files with 19 additions and 3 deletions

View File

@ -11,6 +11,7 @@
1. 【Server】节点首页右上角管理路径错误(感谢@其锋)
2. 【Server】查看用户操作日志支持筛选用户
3. 数据路面权限判断修护(感谢@Will)
-----------------------------------------------------------

View File

@ -65,14 +65,24 @@ public class ProjectFileControl extends BaseAgentController {
ProjectInfoModel pim = getProjectInfoModel();
MultipartFileBuilder multipartFileBuilder = createMultipart()
.addFieldName("file");
// 压缩文件
String type = getParameter("type");
// 是否清空
String clearType = getParameter("clearType");
String levelName = getParameter("levelName");
File lib;
if (StrUtil.isEmpty(levelName)) {
lib = new File(pim.getLib());
} else {
lib = FileUtil.file(pim.getLib(), levelName);
}
if ("unzip".equals(type)) {
multipartFileBuilder.setInputStreamType("zip");
multipartFileBuilder.setSavePath(AgentConfigBean.getInstance().getTempPathName());
String path = multipartFileBuilder.save();
//
File lib = new File(pim.getLib());
// 判断是否需要清空
if ("clear".equalsIgnoreCase(clearType)) {
if (!FileUtil.clean(lib)) {
@ -86,7 +96,7 @@ public class ProjectFileControl extends BaseAgentController {
DefaultSystemLog.LOG().info("删除失败:" + file.getPath());
}
} else {
multipartFileBuilder.setSavePath(pim.getLib())
multipartFileBuilder.setSavePath(FileUtil.getAbsolutePath(lib))
.setUseOriginalFilename(true);
// 保存
multipartFileBuilder.save();

View File

@ -35,6 +35,8 @@ public class CommandUtil {
if (BaseJpomApplication.OS_INFO.isLinux()) {
//执行linux系统命令
cmd = new String[]{"/bin/sh", "-c", command};
} else if (BaseJpomApplication.OS_INFO.isMac()) {
cmd = new String[]{"/bin/sh", "-c", command};
} else {
cmd = new String[]{"cmd", "/c", command};
}

View File

@ -137,7 +137,7 @@
data: {
id: '$id',
levelName: function () {
return $("#currentPath").text();
}
},
multiple: true,
@ -211,6 +211,9 @@
type: "unzip",
clearType: function () {
return $("#uploadFile_Import").attr("type");
},
levelName: function () {
return $("#currentPath").text();
}
},
multiple: false,