fix: 脚本编辑路径始终用 pending/,避免与七牛云 approved/ 冲突
This commit is contained in:
@@ -265,9 +265,13 @@ public class AdminController {
|
||||
if (scriptPath == null || scriptPath.isBlank()) {
|
||||
String hash = config.getConfigHash() != null ? config.getConfigHash().substring(0, 8)
|
||||
: Long.toHexString(System.currentTimeMillis());
|
||||
// 始终用 pending 目录,审批通过时才移到 approved
|
||||
scriptPath = String.format("configs/%s/pending/%s.groovy", config.getSiteId(), hash);
|
||||
config.setScriptStoragePath(scriptPath);
|
||||
} else {
|
||||
// 已有路径也强制用 pending 目录
|
||||
scriptPath = scriptPath.replace("/approved/", "/pending/");
|
||||
}
|
||||
config.setScriptStoragePath(scriptPath);
|
||||
// 只保存到本地,审批通过时才同步到七牛云
|
||||
localStorageService.store(scriptPath, script);
|
||||
siteConfigMapper.updateById(config);
|
||||
|
||||
Reference in New Issue
Block a user