refactor(env): 更新 AI 助手 URL 并添加环境判断- 更新生产环境下的 AI 助手 URL

- 在创建项目页面中添加环境判断,根据不同环境使用不同 URL
This commit is contained in:
du.meimei
2025-05-29 13:55:38 +08:00
parent 7fff292fc9
commit c72cd93e03
2 changed files with 9 additions and 4 deletions

View File

@@ -14,4 +14,5 @@ VUE_APP_JSONPURL = 'https://iam.digitalyili.com/idp/restful/getIDPToken'
VUE_APP_YQRURL = 'https://ocp.digitalyili.com'
# 伊调研问卷助手
VUE_APP_AI_ASSISTANT_URL = 'https://yiligpt.x.digitalyili.com/aiagent/assistant/b4834e30-0de9-4741-87f3-9fb4af5184cb/share'
# VUE_APP_AI_ASSISTANT_URL = 'https://yiligpt.x.digitalyili.com/aiagent/assistant/b4834e30-0de9-4741-87f3-9fb4af5184cb/share'
VUE_APP_AI_ASSISTANT_URL = 'https://yiligpt.x.digitalyili.com/aiagent/assistant/1179e9d7-fb94-4fe4-abbb-55be8f8ca5d6/share'

View File

@@ -329,9 +329,13 @@ const aiAssistantUrlWithToken = computed(() => {
// 使用 encodeURIComponent 转义 token
const encodedToken = encodeURIComponent(token.value);
// 使用 URL 对象安全拼接参数
const url = new URL( window.location.origin + '/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share');
let env = process.env.VUE_APP_CURRENTMODE
let url = ''
if (env === 'prod'){
url = new URL( window.location.origin + '/aiagent/assistant/1179e9d7-fb94-4fe4-abbb-55be8f8ca5d6/share');
}else{
url = new URL( window.location.origin + '/aiagent/assistant/78907182-cc42-4072-abae-86ef67c1ecd3/share');
}
url.searchParams.append('token', encodedToken);
url.searchParams.append('source', 'pc');
return url.toString();