白名单提示

This commit is contained in:
jiangzeyin 2019-04-08 18:28:33 +08:00
parent 69d9f4fa14
commit 5cd80ce4df
2 changed files with 9 additions and 11 deletions

View File

@ -106,7 +106,7 @@ public class NginxController extends BaseController {
return JsonMessage.getString(400, "文件名存在非法字符");
}
if (!whitelistDirectoryService.checkNgxDirectory(whitePath)) {
throw new RuntimeException("请选择正确的项目路径,或者还没有配置白名单");
return JsonMessage.getString(400, "请选择正确的白名单");
}
boolean add = "add".equals(genre);
if ("quick".equals(type)) {

View File

@ -34,16 +34,14 @@ public class JpomManifest {
}
if (manifestResources != null) {
while (manifestResources.hasMoreElements()) {
try {
try (InputStream inputStream = manifestResources.nextElement().openStream()) {
Manifest manifest = new Manifest(inputStream);
Attributes attributes = manifest.getMainAttributes();
String version = attributes.getValue("Jpom-Project-Version");
if (version != null) {
JPOM_MANIFEST.setVersion(version);
String timeStamp = attributes.getValue("Jpom-Timestamp");
JPOM_MANIFEST.setTimeStamp(timeStamp);
}
try (InputStream inputStream = manifestResources.nextElement().openStream()) {
Manifest manifest = new Manifest(inputStream);
Attributes attributes = manifest.getMainAttributes();
String version = attributes.getValue("Jpom-Project-Version");
if (version != null) {
JPOM_MANIFEST.setVersion(version);
String timeStamp = attributes.getValue("Jpom-Timestamp");
JPOM_MANIFEST.setTimeStamp(timeStamp);
}
} catch (Exception ignored) {
}