fix: 修复插件保存后的分类关联
- 插件保存接口返回实体以便前端拿到真实插件 ID - 分类关联更新改为按差异增删并补充事务保护 - 新建插件后缺失 ID 时明确抛出错误
This commit is contained in:
@@ -145,12 +145,10 @@ function save() {
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.errorCode === 0) {
|
||||
const pluginId =
|
||||
res.data?.id ||
|
||||
res.data ||
|
||||
plainEntity.id ||
|
||||
entity.value.id ||
|
||||
'';
|
||||
const pluginId = res.data?.id || plainEntity.id || entity.value.id;
|
||||
if (!pluginId) {
|
||||
throw new Error('插件保存成功,但未返回插件ID');
|
||||
}
|
||||
await syncPluginCategories(pluginId, categoryIds);
|
||||
dialogVisible.value = false;
|
||||
ElMessage.success($t('message.saveOkMessage'));
|
||||
|
||||
Reference in New Issue
Block a user