fix(frontend): 优化开发代理请求头以支持初始化同源校验
Some checks are pending
Build and Release / Build Release Package (tar.gz, amd64, linux) (push) Waiting to run
Build and Release / Build Release Package (tar.gz, arm64, linux) (push) Waiting to run
Build and Release / Build Release Package (zip, amd64, windows) (push) Waiting to run

This commit is contained in:
xuans 2026-10-20 11:27:46 +08:00
parent ce17ec48a6
commit 76d2321ed4

View File

@ -9,10 +9,15 @@ export default defineConfig({
},
server: (() => {
const apiTarget = process.env.SCERT_API_TARGET || 'https://127.0.0.1:5200';
const targetUrl = new URL(apiTarget);
const apiProxy = {
target: apiTarget,
changeOrigin: false,
changeOrigin: true,
secure: false,
headers: {
Origin: targetUrl.origin,
'Sec-Fetch-Site': 'same-origin',
},
};
return {