diff --git a/.env.development b/.env.development index c581825..b10b50c 100644 --- a/.env.development +++ b/.env.development @@ -7,6 +7,8 @@ VITE_APP_ENV = 'development' # AIx融合数字管理系统/开发环境 VITE_APP_BASE_API = '/dev-api' +VITE_APP_DOMAIN = 'file.ysaix.com' + VITE_APP_UPLOAD_API = 'http://192.168.2.52:7863' VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktxt/' diff --git a/.env.production b/.env.production index 380f9d6..993cace 100644 --- a/.env.production +++ b/.env.production @@ -7,6 +7,8 @@ VITE_APP_ENV = 'production' # AIx融合数字管理系统/生产环境 VITE_APP_BASE_API = 'https://file.ysaix.com:7868/prod-api' +VITE_APP_DOMAIN = 'file.ysaix.com' + VITE_APP_UPLOAD_API = 'https://file.ysaix.com:7868/prod-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index 9b9c503..c48cc00 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -24,8 +24,8 @@ export default defineConfig({ server: { proxy: { '/dev-api': { - // target: 'http://27.128.240.72:7865', - target: 'http://192.168.2.52:7863', + target: 'http://27.128.240.72:7865', + // target: 'http://192.168.2.52:7863', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') } diff --git a/src/renderer/src/utils/linkConfig.js b/src/renderer/src/utils/linkConfig.js index 1033e66..38340d1 100644 --- a/src/renderer/src/utils/linkConfig.js +++ b/src/renderer/src/utils/linkConfig.js @@ -4,15 +4,14 @@ import useUserStore from '@/store/modules/user' const userStore = useUserStore() const baseConfig = { // Electron 设置cookie - // url: import.meta.env.VITE_APP_BASE_API, - url: 'https://file.ysaix.com:7868', - //cookie 名称 这里为 token + url: import.meta.env.VITE_APP_BUILD_BASE_PATH, + // url: 'https://file.ysaix.com:7868', + //cookie 名称 这里为 token name: 'Admin-Token', //cookie 值 value: userStore.token, // 域名 - domain: 'file.ysaix.com', - + domain: import.meta.env.VITE_APP_DOMAIN } // 作业布置 @@ -53,4 +52,4 @@ export default { gk, standard, aiModel -} \ No newline at end of file +}