🔨 优化异常处理逻辑.

This commit is contained in:
lijiahangmax
2025-12-03 09:45:21 +08:00
parent 528cfc90f2
commit 14dc8e0407
21 changed files with 27 additions and 75 deletions

View File

@@ -227,8 +227,6 @@
}
// 清空
handlerClear();
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -188,7 +188,7 @@
const queryOrder = useQueryOrder(TableName, DESC);
const { tableColumns, columnsHook } = useTableColumns(TableName, columns);
const { loading, setLoading } = useLoading();
const { toOptions, getDictValue } = useDictStore();
const { getDictValue } = useDictStore();
const selectedKeys = ref<Array<number>>([]);
const tableRenderData = ref<Array<DictKeyQueryResponse>>([]);
@@ -207,7 +207,6 @@
Message.success('删除成功');
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -223,7 +222,6 @@
selectedKeys.value = [];
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -246,7 +244,6 @@
// 查看
const { data } = await getDictValueList([record.keyName]);
emits('openView', data[record.keyName], `${record.keyName} - ${record.description}`);
} catch (e) {
} finally {
setLoading(false);
}
@@ -260,7 +257,6 @@
Message.success('刷新成功 页面缓存刷新后生效');
// 加载字典数据
fetchTableData();
} catch (e) {
} finally {
setLoading(false);
}
@@ -276,7 +272,6 @@
pagination.current = request.page;
pagination.pageSize = request.limit;
selectedKeys.value = [];
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -204,8 +204,6 @@
}
// 清空
handlerClear();
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -189,7 +189,6 @@
selectedKeys.value = [];
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -204,7 +203,6 @@
Message.success('删除成功');
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -243,7 +241,6 @@
pagination.current = request.page;
pagination.pageSize = request.limit;
selectedKeys.value = [];
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -249,8 +249,6 @@
}
// 清空
handlerClear();
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -265,7 +265,6 @@
}
cacheStore.reset('menus');
Message.success('删除成功');
} catch (e) {
} finally {
setFetchLoading(false);
}
@@ -289,7 +288,6 @@
if (all) {
cacheStore.set('menus', data);
}
} catch (e) {
} finally {
setFetchLoading(false);
}
@@ -318,7 +316,6 @@
Message.success('刷新成功 页面缓存刷新后生效');
// 加载菜单数据
await loadMenuData(true);
} catch (e) {
} finally {
setFetchLoading(false);
}

View File

@@ -211,8 +211,6 @@
}
// 清空
handlerClear();
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -213,7 +213,6 @@
Message.success('删除成功');
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -236,7 +235,6 @@
pagination.total = data.total;
pagination.current = request.page;
pagination.pageSize = request.limit;
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -104,8 +104,6 @@
}
handleClose();
return true;
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -167,7 +167,6 @@
Message.success('删除成功');
// 重新加载
reload();
} catch (e) {
} finally {
setLoading(false);
}
@@ -196,7 +195,6 @@
pagination.total = data.total;
pagination.current = request.page;
pagination.pageSize = request.limit;
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -147,7 +147,6 @@
ungroupedItems.value = data.ungroupedItems || [];
// 设置状态
filterSnippet();
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -122,8 +122,6 @@
}
// 清空
handlerClear();
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -215,7 +215,6 @@
extra: JSON.stringify({ alias: item.alias })
});
item.editable = false;
} catch (e) {
} finally {
item.loading = false;
item.modCount = 0;

View File

@@ -149,7 +149,6 @@
ungroupedItems.value = data.ungroupedItems || [];
// 设置状态
filterPath();
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -126,8 +126,6 @@
}
handleClose();
return true;
} catch (e) {
return false;
} finally {
setLoading(false);
}

View File

@@ -127,7 +127,6 @@
extra: value as string
});
Message.success('保存成功');
} catch (e) {
} finally {
setLoading(false);
}

View File

@@ -175,7 +175,6 @@
keys: shortcutKeys.value
} as TerminalShortcutSetting);
Message.success('保存成功');
} catch (e) {
} finally {
setLoading(false);
}
@@ -232,7 +231,6 @@
onMounted(async () => {
try {
await loadUserPreference();
} catch (e) {
} finally {
render.value = true;
}

View File

@@ -86,19 +86,15 @@
// 确定
const handlerOk = async () => {
try {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
// 提权
if (props.session) {
props.session.chmod(formModel.value.path, formModel.value.mod);
}
} catch (e) {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
// 提权
if (props.session) {
props.session.chmod(formModel.value.path, formModel.value.mod);
}
};
</script>

View File

@@ -67,24 +67,20 @@
// 确定
const handlerOk = async () => {
try {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
if (props.session) {
if (touch.value) {
// 创建文件
props.session.touch(formModel.value.path);
} else {
// 创建文件夹
props.session.mkdir(formModel.value.path);
}
}
} catch (e) {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
if (props.session) {
if (touch.value) {
// 创建文件
props.session.touch(formModel.value.path);
} else {
// 创建文件夹
props.session.mkdir(formModel.value.path);
}
}
};
</script>

View File

@@ -72,19 +72,15 @@
// 确定
const handlerOk = async () => {
try {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
// 移动文件
if (props.session) {
props.session.move(formModel.value.path, formModel.value.target);
}
} catch (e) {
// 验证参数
const error = await formRef.value.validate();
if (error) {
return false;
}
// 移动文件
if (props.session) {
props.session.move(formModel.value.path, formModel.value.target);
}
};
</script>

View File

@@ -183,7 +183,6 @@
Message.error(`主机 ${connectHostId} 不存在/无权限`);
}
}
} catch (e) {
} finally {
setLoading(false);
}