From f56c40bb6dafaf1bbbdb2d9bf265adbaecd427cc Mon Sep 17 00:00:00 2001 From: xuan <1359774872@qq.com> Date: Fri, 30 Oct 2026 11:01:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=9C=B0=E5=9D=80=E5=B9=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=94=B9=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- .env.zhoushang | 4 ++-- src/common/config.js | 4 ++-- src/store/index.js | 19 ++++--------------- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.env b/.env index 1c97cdb..dd0edda 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ NODE_ENV = production VUE_APP_ENV_NAME = zhoushang环境 VUE_APP_UPGRADE_NAME = erp_pda_zhoushang -VUE_APP_PRODUCTION_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1 -VUE_APP_DEV_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1 +VUE_APP_PRODUCTION_API_URL = https://zsfz.yushangfangzhi.com/server/hcscm/pda/v1 +VUE_APP_DEV_API_URL = https://zsfz.yushangfangzhi.com/server/hcscm/pda/v1 diff --git a/.env.zhoushang b/.env.zhoushang index cf32d57..dd0edda 100644 --- a/.env.zhoushang +++ b/.env.zhoushang @@ -1,5 +1,5 @@ NODE_ENV = production VUE_APP_ENV_NAME = zhoushang环境 VUE_APP_UPGRADE_NAME = erp_pda_zhoushang -VUE_APP_PRODUCTION_API_URL = https://zsfz.yushangfangzhi.com/server/pda/v1 -VUE_APP_DEV_API_URL = https://zsfz.yushangfangzhi.com/server/pda/v1 +VUE_APP_PRODUCTION_API_URL = https://zsfz.yushangfangzhi.com/server/hcscm/pda/v1 +VUE_APP_DEV_API_URL = https://zsfz.yushangfangzhi.com/server/hcscm/pda/v1 diff --git a/src/common/config.js b/src/common/config.js index 2217b90..f436a80 100644 --- a/src/common/config.js +++ b/src/common/config.js @@ -26,8 +26,8 @@ const config = { // 开发环境API URL选项(服务名段 hcscm) devApiUrlOptions: [ { label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm/pda/v1' }, - { label: '本地环境', value: 'http://192.168.1.66:7010/hcscm/pda/v1' }, - { label: '本地穿透', value: 'https://2yd52gx88533.vicp.fun/hcscm/pda/v1' }, + // { label: '本地环境', value: 'http://192.168.1.66:7010/hcscm/pda/v1' }, + // { label: '本地穿透', value: 'https://2yd52gx88533.vicp.fun/hcscm/pda/v1' }, { label: '正式环境', value: process.env.VUE_APP_PRODUCTION_API_URL }, { label: '自定义', value: 'custom' } ] diff --git a/src/store/index.js b/src/store/index.js index 07ac109..d1f17ec 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -19,24 +19,14 @@ try{ } -// 本分支统一使用 hcscm 服务前缀 -function normalizeApiUrl(url) { - return String(url || '').replace(/hcscm_weave/g, 'hcscm'); -} - // 初始化API URL function initApiUrl() { const fallbackUrl = (config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl; try { - const savedApiUrl = uni.getStorageSync('ApiUrl'); - const url = normalizeApiUrl(savedApiUrl || fallbackUrl); - if (savedApiUrl && url !== savedApiUrl) { - uni.setStorageSync('ApiUrl', url); - } - return url; + return uni.getStorageSync('ApiUrl') || fallbackUrl; } catch (e) { console.log('读取存储的 apiurl 失败', e); - return normalizeApiUrl(fallbackUrl); + return fallbackUrl; } } @@ -109,9 +99,8 @@ const store = new Vuex.Store({ state.vuex_notificationAudio = audio; }, SET_API_URL(state, url) { - const nextUrl = normalizeApiUrl(url); - state.apiurl = nextUrl - uni.setStorageSync('ApiUrl', nextUrl) + state.apiurl = url + uni.setStorageSync('ApiUrl', url) } },