From dbdb41fecdffc1ba3440ab86a999a03a4a8c7f5a Mon Sep 17 00:00:00 2001 From: "liu.xiaofeng@ebiz-digits.com" Date: Thu, 26 Oct 2023 15:35:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E9=99=A9=E7=BB=AD=E4=BF=9D?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/index.js | 46 ++++++------- .../ebiz/healthInsuranceRenewal/detail.vue | 29 ++++++++- .../ebiz/healthInsuranceRenewal/list.vue | 65 ++++++++++++------- 3 files changed, 93 insertions(+), 47 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index 31873aeb8..8563bb643 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -29,29 +29,29 @@ function getSearchString (key) { } return obj[key] } -let apiVersion = 'v2' -var ua = window.navigator.userAgent.toLowerCase() -//通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信 -if (localStorage.getItem('apiVersion')) { - apiVersion = localStorage.getItem('apiVersion') -} else { - if (ua.match(/MicroMessenger/i) == 'micromessenger') { - //report/reportList数据报表页面在浏览器可以打开了,但在微信或企业微信中打开不了,接口请求不需要token - if (window.location.href.indexOf('apiVersion') > 0) { - apiVersion = getSearchString('apiVersion') == 'V3' ? 'v3' : 'v2';//url中apiVersion没有时,为v2 - } else { - apiVersion = 'v3' - } - } else { - // 在app - if (navigator.userAgent.indexOf('JZG_') > 0) { - apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3' ? 'v3' : 'v2' - } - } - window.localStorage.setItem('apiVersion', apiVersion) -} -// 可以多个接口域名,按需添加 -console.log('环境:', process.env.VUE_APP_FLAG) +let apiVersion = 'v1' +// var ua = window.navigator.userAgent.toLowerCase() +// //通过正则表达式匹配ua中是否含有MicroMessenger字符串, 在微信 +// if (localStorage.getItem('apiVersion')) { +// apiVersion = localStorage.getItem('apiVersion') +// } else { +// if (ua.match(/MicroMessenger/i) == 'micromessenger') { +// //report/reportList数据报表页面在浏览器可以打开了,但在微信或企业微信中打开不了,接口请求不需要token +// if (window.location.href.indexOf('apiVersion') > 0) { +// apiVersion = getSearchString('apiVersion') == 'V3' ? 'v3' : 'v2';//url中apiVersion没有时,为v2 +// } else { +// apiVersion = 'v3' +// } +// } else { +// // 在app +// if (navigator.userAgent.indexOf('JZG_') > 0) { +// apiVersion = navigator.userAgent.split('JZG_')[1].split('/')[0].split('_')[1] == 'V3' ? 'v3' : 'v2' +// } +// } +// window.localStorage.setItem('apiVersion', apiVersion) +// } +// // 可以多个接口域名,按需添加 +// console.log('环境:', process.env.VUE_APP_FLAG) switch (process.env.VUE_APP_FLAG) { case 'dev': apiDomain = 'https://iagentsales-test2.e-guofu.com:5200/api/' + apiVersion // 国富api ///api/v1 diff --git a/src/views/ebiz/healthInsuranceRenewal/detail.vue b/src/views/ebiz/healthInsuranceRenewal/detail.vue index 2d80abf51..453f0975f 100644 --- a/src/views/ebiz/healthInsuranceRenewal/detail.vue +++ b/src/views/ebiz/healthInsuranceRenewal/detail.vue @@ -40,6 +40,8 @@