mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-24 16:29:45 +00:00
[Electron] Fix initial default install location validation (#1592)
This commit is contained in:
@@ -85,6 +85,8 @@ onMounted(async () => {
|
||||
appData.value = paths.appData
|
||||
appPath.value = paths.appPath
|
||||
installPath.value = paths.defaultInstallPath
|
||||
|
||||
await validatePath(paths.defaultInstallPath)
|
||||
})
|
||||
|
||||
const validatePath = async (path: string) => {
|
||||
|
||||
@@ -8,7 +8,9 @@ import {
|
||||
import LayoutDefault from '@/views/layouts/LayoutDefault.vue'
|
||||
import { isElectron } from './utils/envUtil'
|
||||
|
||||
const isFileProtocol = () => window.location.protocol === 'file:'
|
||||
const isFileProtocol = window.location.protocol === 'file:'
|
||||
const basePath = isElectron() ? '/' : window.location.pathname
|
||||
|
||||
const guardElectronAccess = (
|
||||
to: RouteLocationNormalized,
|
||||
from: RouteLocationNormalized,
|
||||
@@ -22,12 +24,12 @@ const guardElectronAccess = (
|
||||
}
|
||||
|
||||
const router = createRouter({
|
||||
history: isFileProtocol()
|
||||
history: isFileProtocol
|
||||
? createWebHashHistory()
|
||||
: // Base path must be specified to ensure correct relative paths
|
||||
// Example: For URL 'http://localhost:7801/ComfyBackendDirect',
|
||||
// we need this base path or assets will incorrectly resolve from 'http://localhost:7801/'
|
||||
createWebHistory(window.location.pathname),
|
||||
createWebHistory(basePath),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
|
||||
Reference in New Issue
Block a user