fix: serde::json passing IVerge to the front end without deserialization

This commit is contained in:
huzibaca
2024-11-21 06:01:56 +08:00
parent 4d0dbdaced
commit a89a828b35
6 changed files with 169 additions and 27 deletions

View File

@@ -20,7 +20,7 @@ export async function patchProfilesConfig(profiles: IProfilesConfig) {
export async function createProfile(
item: Partial<IProfileItem>,
fileData?: string | null
fileData?: string | null,
) {
return invoke<void>("create_profile", { item, fileData });
}
@@ -61,7 +61,7 @@ export async function deleteProfile(index: string) {
export async function patchProfile(
index: string,
profile: Partial<IProfileItem>
profile: Partial<IProfileItem>,
) {
return invoke<void>("patch_profile", { index, profile });
}
@@ -132,19 +132,19 @@ export async function getAppDir() {
export async function openAppDir() {
return invoke<void>("open_app_dir").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
Notice.error(err?.message || err.toString(), 1500),
);
}
export async function openCoreDir() {
return invoke<void>("open_core_dir").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
Notice.error(err?.message || err.toString(), 1500),
);
}
export async function openLogsDir() {
return invoke<void>("open_logs_dir").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
Notice.error(err?.message || err.toString(), 1500),
);
}
@@ -155,7 +155,7 @@ export async function openWebUrl(url: string) {
export async function cmdGetProxyDelay(
name: string,
timeout: number,
url?: string
url?: string,
) {
name = encodeURIComponent(name);
return invoke<{ delay: number }>("clash_api_get_proxy_delay", {
@@ -183,7 +183,7 @@ export async function checkService() {
}
export async function invoke_uwp_tool() {
return invoke<void>("invoke_uwp_tool").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
Notice.error(err?.message || err.toString(), 1500),
);
}
@@ -201,7 +201,7 @@ export async function exitApp() {
export async function copyIconFile(
path: string,
name: "common" | "sysproxy" | "tun"
name: "common" | "sysproxy" | "tun",
) {
return invoke<void>("copy_icon_file", { path, name });
}
@@ -233,7 +233,7 @@ export async function restoreWebDavBackup(filename: string) {
export async function saveWebdavConfig(
url: string,
username: string,
password: String
password: String,
) {
return invoke<void>("save_webdav_config", {
url,