fix(desktop): disable web security for CORS and fix dev server port (#648)

- Set webSecurity: false in BrowserWindow to bypass CORS when
  connecting to remote API (standard Electron practice)
- Fix renderer dev server to port 5173 so localStorage persists
  across restarts (prevents losing login state)
This commit is contained in:
Bohan Jiang
2026-04-10 18:20:30 +08:00
committed by GitHub
parent b52c048c8e
commit 8bcb773304
2 changed files with 5 additions and 0 deletions

View File

@@ -11,6 +11,10 @@ export default defineConfig({
plugins: [externalizeDepsPlugin()],
},
renderer: {
server: {
port: 5173,
strictPort: true,
},
plugins: [react(), tailwindcss()],
resolve: {
alias: {

View File

@@ -17,6 +17,7 @@ function createWindow(): void {
webPreferences: {
preload: join(__dirname, "../preload/index.js"),
sandbox: false,
webSecurity: false,
},
});