fix: 修复 preload 路径 (.mjs 而不是 .js)
- electron-vite v3 输出 .mjs 文件 - 更新 preload 路径为 index.mjs - 这是 window.electronAPI undefined 的根本原因
This commit is contained in:
@@ -126,6 +126,9 @@ export const useConnectionStore = defineStore('connection', () => {
|
||||
async function testConnection(opts: {
|
||||
host: string; port: number; auth?: string; username?: string; tls?: boolean
|
||||
}): Promise<{ success: boolean; error?: string }> {
|
||||
if (!window.electronAPI) {
|
||||
return { success: false, error: 'Electron API not ready' }
|
||||
}
|
||||
const testId = `test_${Date.now()}`
|
||||
try {
|
||||
const result = await window.electronAPI.redis.connect(testId, {
|
||||
|
||||
Reference in New Issue
Block a user