fix
This commit is contained in:
parent
35ae5649ac
commit
49b9249d56
@ -7,12 +7,13 @@ import tailwindcss from '@tailwindcss/vite';
|
|||||||
import basicSsl from '@vitejs/plugin-basic-ssl';
|
import basicSsl from '@vitejs/plugin-basic-ssl';
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
const plugins = [tailwindcss()]
|
const plugins = [tailwindcss()];
|
||||||
const isCNB = process.env.CNB === 'true';
|
const isCNB = process.env.CNB === 'true';
|
||||||
if (isDev && !isCNB) {
|
if (isDev && !isCNB) {
|
||||||
plugins.push(basicSsl());
|
plugins.push(basicSsl());
|
||||||
}
|
}
|
||||||
let target = process.env.VITE_API_URL || 'http://localhost:3000';
|
let target = process.env.VITE_API_URL || 'https://localhost:51015';
|
||||||
|
const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' };
|
||||||
let proxy = {
|
let proxy = {
|
||||||
'/root/center/': {
|
'/root/center/': {
|
||||||
target: `${target}/root/center/`,
|
target: `${target}/root/center/`,
|
||||||
@ -20,13 +21,8 @@ let proxy = {
|
|||||||
'/user/login/': {
|
'/user/login/': {
|
||||||
target: `${target}/user/login/`,
|
target: `${target}/user/login/`,
|
||||||
},
|
},
|
||||||
'/api': {
|
'/api': apiProxy,
|
||||||
target: target,
|
'/client': apiProxy,
|
||||||
changeOrigin: true,
|
|
||||||
ws: true,
|
|
||||||
rewriteWsOrigin: true,
|
|
||||||
cookieDomainRewrite: 'localhost',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user