From c911e9b1a83e4cf17e9a9b32e7b9444503b460f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E8=BF=9B?= Date: Fri, 6 Nov 2026 23:27:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=86=E9=94=80=E7=A0=81=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=9C=B0=E5=9D=80=E6=8C=89=E7=8E=AF=E5=A2=83=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E7=94=9F=E4=BA=A7=E6=8C=87=E5=90=91=20cmp-ad?= =?UTF-8?q?min.xm-iot.cn=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=86=99=E6=AD=BB?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 3 +++ env/.env.development | 3 +++ env/.env.production | 3 +++ env/.env.test | 3 +++ src/pages/agent-system/distribution-code/index.vue | 3 ++- types/env.d.ts | 2 ++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/env/.env b/env/.env index 2fd8ecc..ee7d8d6 100644 --- a/env/.env +++ b/env/.env @@ -7,6 +7,9 @@ VITE_APP_ENV=development # 接口地址 VITE_API_BASE_URL=https://cmp-api.boss160.cn +# 管理后台地址(代理分销码注册页所在站点) +VITE_ADMIN_BASE_URL=https://cmp-admin.boss160.cn + # 端口号 VITE_APP_PORT=9527 diff --git a/env/.env.development b/env/.env.development index 313d9ce..22b02ed 100644 --- a/env/.env.development +++ b/env/.env.development @@ -4,6 +4,9 @@ VITE_APP_ENV=development # 接口地址 VITE_API_BASE_URL=https://cmp-api.boss160.cn +# 管理后台地址(代理分销码注册页所在站点) +VITE_ADMIN_BASE_URL=https://cmp-admin.boss160.cn + # 是否使用代理 (H5开发环境使用代理解决跨域) VITE_APP_PROXY=true diff --git a/env/.env.production b/env/.env.production index 0d916b3..a5977b5 100644 --- a/env/.env.production +++ b/env/.env.production @@ -4,6 +4,9 @@ VITE_APP_ENV=production # 接口地址 VITE_API_BASE_URL=https://cmp-api.xm-iot.cn +# 管理后台地址(代理分销码注册页所在站点) +VITE_ADMIN_BASE_URL=https://cmp-admin.xm-iot.cn + # 是否使用代理 (生产环境不使用代理) VITE_APP_PROXY=false diff --git a/env/.env.test b/env/.env.test index 14407bd..157497c 100644 --- a/env/.env.test +++ b/env/.env.test @@ -4,6 +4,9 @@ VITE_APP_ENV=staging # 接口地址 VITE_API_BASE_URL=https://cmp-api.boss160.cn +# 管理后台地址(代理分销码注册页所在站点) +VITE_ADMIN_BASE_URL=https://cmp-admin.boss160.cn + # 是否使用代理 (测试环境不使用代理) VITE_APP_PROXY=false diff --git a/src/pages/agent-system/distribution-code/index.vue b/src/pages/agent-system/distribution-code/index.vue index 78467e1..9702b50 100644 --- a/src/pages/agent-system/distribution-code/index.vue +++ b/src/pages/agent-system/distribution-code/index.vue @@ -52,7 +52,8 @@ const distributionCode = ref(''); const errorMessage = ref(''); function getRegistrationUrl(code: string) { - return `https://cmp-admin.boss160.cn/agent-registration#/agent-registration?distribution_code=${encodeURIComponent(code)}`; + const adminBaseUrl = (import.meta.env.VITE_ADMIN_BASE_URL || '').replace(/\/+$/, ''); + return `${adminBaseUrl}/agent-registration#/agent-registration?distribution_code=${encodeURIComponent(code)}`; } function drawQrCode(value: string) { diff --git a/types/env.d.ts b/types/env.d.ts index f86703b..3aca4e2 100644 --- a/types/env.d.ts +++ b/types/env.d.ts @@ -5,6 +5,8 @@ interface ImportMetaEnv { VITE_APP_ENV: string; /** 接口地址 */ VITE_API_BASE_URL: string; + /** 管理后台地址(代理分销码注册页所在站点) */ + VITE_ADMIN_BASE_URL: string; /** 端口号 */ VITE_APP_PORT: string; /** h5是否需要配置代理 */