This commit is contained in:
2026-01-22 23:47:42 +08:00
parent 7cf734dd5b
commit 5e5f56fc9a
8 changed files with 90 additions and 568 deletions

View File

@@ -7,28 +7,13 @@ const centerEnv = process.env.CENTER_ENV;
const plugins: any[] = [];
plugins.push(tailwindcss());
const meBackend = 'https://kevisual.xiongxiao.me';
const backend = meBackend;
let proxy = {};
if (true) {
proxy = {
'/api': {
target: backend,
changeOrigin: true,
ws: true,
cookieDomainRewrite: 'localhost',
rewrite: (path: any) => path.replace(/^\/api/, '/api'),
},
'/user/login': {
target: backend,
changeOrigin: true,
cookieDomainRewrite: 'localhost',
rewrite: (path: any) => path.replace(/^\/user/, '/user'),
},
'/test': {
target: backend,
},
};
}
let target = meBackend || 'http://localhost:51515';
const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' };
let proxy = {
'/root/': apiProxy,
'/api': apiProxy,
'/client': apiProxy,
};
// https://vitejs.dev/config/
export default defineConfig({