Add administrator-controlled IP project entry redirects
This commit is contained in:
1 parent
1f25bbd1f9
commit
2f93fb023a
13 files changed
+439
-5
No files matched your search
@@ -161,6 +161,7 @@ public class AdminController {
|
||||
Map.entry("mainDomain", 253),
|
||||
Map.entry("deploymentDomain", 253),
|
||||
Map.entry("domainDeliveryTarget", 253),
|
||||
Map.entry("ipEntryOrigin", 100),
|
||||
Map.entry("domainTemplate", 300),
|
||||
Map.entry("filing", 100),
|
||||
Map.entry("footer", 500),
|
||||
@@ -190,18 +191,22 @@ public class AdminController {
|
||||
&& !e.getValue().isEmpty()
|
||||
&& !e.getValue().matches("https://[^\\s]+|/brand/[A-Za-z0-9_.-]+"))
|
||||
throw new ApiError.Failure(400, "Logo 需要 HTTPS 地址");
|
||||
String value =
|
||||
e.getKey().equals("ipEntryOrigin")
|
||||
? IpEntryService.validateOrigin(e.getValue())
|
||||
: e.getValue();
|
||||
users
|
||||
.db()
|
||||
.update(
|
||||
"UPDATE system_settings SET setting_value=?,updated_at=CURRENT_TIMESTAMP WHERE"
|
||||
+ " setting_key=?",
|
||||
e.getValue(),
|
||||
value,
|
||||
e.getKey());
|
||||
audit(
|
||||
actor.id(),
|
||||
"SETTING_UPDATE",
|
||||
e.getKey(),
|
||||
"旧值: " + before.get(e.getKey()) + "; 新值: " + e.getValue(),
|
||||
"旧值: " + before.get(e.getKey()) + "; 新值: " + value,
|
||||
AuthController.ip(req));
|
||||
}
|
||||
return readSettings();
|
||||
|
||||
Reference in new issue
Block a user