chore(config): 更新开发环境配置,替换过期token并提取服务器IP为变量

This commit is contained in:
xudan 2025-11-14 16:27:58 +08:00
parent d1aa9ab66b
commit 7b4af84d65
2 changed files with 8 additions and 5 deletions

View File

@ -4,5 +4,5 @@ ENV_WEBSOCKET_BASE=/ws
ENV_STORAGE_WEBSOCKET_BASE=/vwedWs ENV_STORAGE_WEBSOCKET_BASE=/vwedWs
# 开发环境token配置 - 可以手动设置或从另一个项目获取后填入 # 开发环境token配置 - 可以手动设置或从另一个项目获取后填入
ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjE5MTYzNTIsInVzZXJuYW1lIjoiYWRtaW4ifQ.UEDfpkrB6y1xuNQt5AEKAnAyeEb4HKI8VC0hDXm4r9E ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjMyMjk2MjIsInVzZXJuYW1lIjoiYWRtaW4ifQ.wts41z6BNSag4keXq0cuQALiNnwW5VqRBrC1jsrclTk
ENV_DEV_TENANT_ID=1000 ENV_DEV_TENANT_ID=1000

View File

@ -4,6 +4,9 @@ import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
import Components from 'unplugin-vue-components/vite'; import Components from 'unplugin-vue-components/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
// 服务器IP地址
const SERVER_IP = '192.168.189.118';
export default ({ mode }: Record<string, unknown>) => export default ({ mode }: Record<string, unknown>) =>
defineConfig({ defineConfig({
plugins: [ plugins: [
@ -46,23 +49,23 @@ export default ({ mode }: Record<string, unknown>) =>
proxy: { proxy: {
'/mocks/': { target: 'http://localhost:8888/web-amr' }, '/mocks/': { target: 'http://localhost:8888/web-amr' },
'/api/': { '/api/': {
target: 'http://192.168.189.206:8080/jeecg-boot', target: `http://${SERVER_IP}:8080/jeecg-boot`,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
changeOrigin: true, changeOrigin: true,
}, },
'/vwedApi/': { '/vwedApi/': {
target: 'http://192.168.189.206:8000/', target: `http://${SERVER_IP}:8000/`,
rewrite: (path) => path.replace(/^\/vwedApi/, ''), rewrite: (path) => path.replace(/^\/vwedApi/, ''),
changeOrigin: true, changeOrigin: true,
}, },
'/ws/': { '/ws/': {
target: 'ws://192.168.189.206:8080/jeecg-boot', target: `ws://${SERVER_IP}:8080/jeecg-boot`,
rewrite: (path) => path.replace(/^\/ws/, ''), rewrite: (path) => path.replace(/^\/ws/, ''),
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
}, },
'/vwedWs/': { '/vwedWs/': {
target: 'ws://192.168.189.206:8000/', target: `ws://${SERVER_IP}:8000/`,
rewrite: (path) => path.replace(/^\/vwedWs/, ''), rewrite: (path) => path.replace(/^\/vwedWs/, ''),
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,