feat(env): 添加 AI Agent URL 配置并支持环境变量

- 在 .env.prod 和 .env.uat 文件中添加 VITE_APP_AIAGENTURL 变量
- 修改 IntelligentGeneration 组件,使用环境变量替代硬编码的 URL
This commit is contained in:
Huangzhe
2025-05-29 10:56:25 +08:00
parent e89f554830
commit af323f2c74
3 changed files with 4 additions and 2 deletions

View File

@@ -14,4 +14,5 @@ VITE_APP_YQRURL=https://ocp.digitalyili.com
# VITE_APP_BASE_APPURL=https://ycsb-gw-uat.dcin-test.digitalyili.com # VITE_APP_BASE_APPURL=https://ycsb-gw-uat.dcin-test.digitalyili.com
# VITE_APP_APPKEY=62f495a0f7854e4e46ebbf40 # VITE_APP_APPKEY=62f495a0f7854e4e46ebbf40
# VITE_APP_APPID=m5c66hlce3 # VITE_APP_APPID=m5c66hlce3
VITE_APP_AIAGENTURL=/aiagent/assistant/1179e9d7-fb94-4fe4-abbb-55be8f8ca5d6/share

View File

@@ -31,3 +31,4 @@ VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPTok
VUE_APP_YQRURL = 'https://ocp-uat-ain.digitalyili.com' VUE_APP_YQRURL = 'https://ocp-uat-ain.digitalyili.com'
VITE_APP_AIAGENTURL=/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share

View File

@@ -3,7 +3,7 @@ import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const host = window.location.origin; const host = window.location.origin;
const path = '/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share?'; const path = import.meta.env.VITE_APP_AIAGENTURL + '?';
const param = `token=${encodeURIComponent(localStorage.getItem('plantToken') as string)}&source=app`; const param = `token=${encodeURIComponent(localStorage.getItem('plantToken') as string)}&source=app`;
const url = host + path + param; const url = host + path + param;
const iframe = ref<HTMLIFrameElement | null>(null); const iframe = ref<HTMLIFrameElement | null>(null);