From af323f2c74c58343d3301cb80f07a2ec61eafeda Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Thu, 29 May 2025 10:56:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(env):=20=E6=B7=BB=E5=8A=A0=20AI=20Agent=20?= =?UTF-8?q?URL=20=E9=85=8D=E7=BD=AE=E5=B9=B6=E6=94=AF=E6=8C=81=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 .env.prod 和 .env.uat 文件中添加 VITE_APP_AIAGENTURL 变量 - 修改 IntelligentGeneration 组件,使用环境变量替代硬编码的 URL --- .env.prod | 3 ++- .env.uat | 1 + .../CreateSurvey/components/IntelligentGeneration/Index.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.prod b/.env.prod index 2d7fce4..5c06284 100644 --- a/.env.prod +++ b/.env.prod @@ -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_APPKEY=62f495a0f7854e4e46ebbf40 -# VITE_APP_APPID=m5c66hlce3 \ No newline at end of file +# VITE_APP_APPID=m5c66hlce3 +VITE_APP_AIAGENTURL=/aiagent/assistant/1179e9d7-fb94-4fe4-abbb-55be8f8ca5d6/share \ No newline at end of file diff --git a/.env.uat b/.env.uat index 884b858..ae0b3b9 100644 --- a/.env.uat +++ b/.env.uat @@ -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' +VITE_APP_AIAGENTURL=/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share \ No newline at end of file diff --git a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue index 23b9270..12596a9 100644 --- a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue +++ b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue @@ -3,7 +3,7 @@ import { onMounted, ref } from 'vue'; import { useRouter } from 'vue-router'; 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 url = host + path + param; const iframe = ref(null);