|
@@ -7,7 +7,7 @@ import { ip } from 'address'
|
|
|
// https://vitejs.dev/config/
|
|
|
export default defineConfig(({ mode, command }) => {
|
|
|
const env = loadEnv(mode, process.cwd())
|
|
|
- const { VITE_APP_ENV,VITE_WS_URL } = env
|
|
|
+ const { VITE_APP_ENV,VITE_WS_URL, VITE_API_URL } = env
|
|
|
|
|
|
// 获取本机局域网 IP 地址
|
|
|
const localIP = ip()
|
|
@@ -18,7 +18,8 @@ export default defineConfig(({ mode, command }) => {
|
|
|
base: VITE_APP_ENV === 'production' ? '/' : '/',
|
|
|
plugins: createVitePlugins(env, command === 'build'),
|
|
|
define: {
|
|
|
- __LOCAL_IP__: JSON.stringify(VITE_APP_ENV === 'production' ? `ws://${VITE_WS_URL}:8010/ws` : 'ws://localhost:8010/ws')
|
|
|
+ __LOCAL_IP__: JSON.stringify(VITE_APP_ENV === 'production' ? `ws://${VITE_WS_URL}:8010/ws` : 'ws://localhost:8010/ws'),
|
|
|
+ __LOCAL_API__: JSON.stringify(VITE_API_URL)
|
|
|
},
|
|
|
resolve: {
|
|
|
// https://cn.vitejs.dev/config/#resolve-alias
|