fix: 低优先级收尾 — 图片上传/语言编辑/插件恢复/URL 编码
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- P3-2: ArticleEditor 图片上传接入 /upload 端点 + 封面图上传按钮
- P4-3: recover_plugins 添加 tenant 日志 + 同 ID 去重保护
- P4-4: LanguageManager 编辑弹窗改为真实表单 (name 字段) + 后端 name 持久化
- P4-6: Settings API getSetting/updateSetting 添加 encodeURIComponent
This commit is contained in:
iven
2026-04-26 19:52:42 +08:00
parent b05b7c27a0
commit 8a253a4910
7 changed files with 111 additions and 45 deletions

View File

@@ -455,14 +455,27 @@ impl PluginEngine {
let mut recovered = Vec::new();
for model in running_plugins {
let tenant_id = model.tenant_id;
let manifest: PluginManifest = serde_json::from_value(model.manifest_json.clone())
.map_err(|e| PluginError::InvalidManifest(e.to_string()))?;
let plugin_id_str = &manifest.metadata.id;
// 跳过已被其他租户加载的同 ID 插件WASM 二进制相同,数据隔离在 DB 层)
if self.plugins.contains_key(plugin_id_str) {
tracing::info!(
plugin_id = %plugin_id_str,
tenant_id = %tenant_id,
"Plugin already loaded by another tenant, skipping duplicate load"
);
recovered.push(plugin_id_str.clone());
continue;
}
// 加载 WASM 到内存
if let Err(e) = self.load(plugin_id_str, &model.wasm_binary, manifest.clone()).await {
tracing::error!(
plugin_id = %plugin_id_str,
tenant_id = %tenant_id,
error = %e,
"Failed to recover plugin (load)"
);
@@ -473,6 +486,7 @@ impl PluginEngine {
if let Err(e) = self.initialize(plugin_id_str).await {
tracing::error!(
plugin_id = %plugin_id_str,
tenant_id = %tenant_id,
error = %e,
"Failed to recover plugin (initialize)"
);
@@ -483,13 +497,18 @@ impl PluginEngine {
if let Err(e) = self.start_event_listener(plugin_id_str).await {
tracing::error!(
plugin_id = %plugin_id_str,
tenant_id = %tenant_id,
error = %e,
"Failed to recover plugin (start_event_listener)"
);
continue;
}
tracing::info!(plugin_id = %plugin_id_str, "Plugin recovered");
tracing::info!(
plugin_id = %plugin_id_str,
tenant_id = %tenant_id,
"Plugin recovered"
);
recovered.push(plugin_id_str.clone());
}