🐛 修复window下路径的问题

This commit is contained in:
刘嘉伟 2025-02-13 14:49:44 +08:00
parent 08c2a2cb5a
commit 5451f5bc70

View File

@ -11,10 +11,10 @@ import Breadcrumb from "@/layout/compoenets/Breadcrumb.vue";
import { ElMessage, FormInstance, FormRules } from "element-plus"; import { ElMessage, FormInstance, FormRules } from "element-plus";
import { ipcRenderer } from "electron"; import { ipcRenderer } from "electron";
import { clone } from "@/utils/clone"; import { clone } from "@/utils/clone";
import { formatDate, useClipboard, useDebounceFn } from "@vueuse/core"; import { useClipboard, useDebounceFn } from "@vueuse/core";
import IconifyIconOffline from "@/components/IconifyIcon/src/iconifyIconOffline"; import IconifyIconOffline from "@/components/IconifyIcon/src/iconifyIconOffline";
import commonIps from "./commonIp.json"; import commonIps from "./commonIp.json";
import router from "@/router"; import path from "path";
defineComponent({ defineComponent({
name: "Proxy" name: "Proxy"
@ -565,10 +565,9 @@ const handleRandomProxyName = () => {
`df_${editForm.value.type}_${result}`.toLocaleLowerCase(); `df_${editForm.value.type}_${result}`.toLocaleLowerCase();
}; };
import path from "path"; const normalizePath = (filePath: string) => {
function normalizePath(filePath: string) {
return path.normalize(filePath).replace(/\\/g, "/"); return path.normalize(filePath).replace(/\\/g, "/");
} };
const handleSelectFile = (type: number, ext: string[]) => { const handleSelectFile = (type: number, ext: string[]) => {
ipcRenderer.invoke("file.selectFile", ext).then(r => { ipcRenderer.invoke("file.selectFile", ext).then(r => {