From 3e936b064d01e2a23af7c25229ed86119a35d982 Mon Sep 17 00:00:00 2001 From: HongxuanG <1359774872@qq.com> Date: Mon, 28 Sep 2026 12:13:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=ADApp=E7=AB=AFSSL?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=BB=A5=E5=85=BC=E5=AE=B9=E8=80=81PDA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/http.interceptor.js | 7 +++++++ src/common/util.js | 3 +++ src/main.js | 19 +++++++++++++++++++ src/store/index.js | 3 +++ 4 files changed, 32 insertions(+) diff --git a/src/common/http.interceptor.js b/src/common/http.interceptor.js index 0ede702..d57d510 100644 --- a/src/common/http.interceptor.js +++ b/src/common/http.interceptor.js @@ -25,6 +25,10 @@ const install = (Vue, vm) => { console.log('request', req); console.log('baseUrl', vm.$store.state.apiurl); console.log('完整URL', vm.$store.state.apiurl + req.url); + // #ifdef APP-PLUS + // Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,关闭校验证书 + req.sslVerify = false; + // #endif if (!req.header){ req.header = []; } @@ -163,6 +167,9 @@ const install = (Vue, vm) => { uni.request({ url, method: 'PUT', + // #ifdef APP-PLUS + sslVerify: false, + // #endif header: { ...header, 'Platform': 2, diff --git a/src/common/util.js b/src/common/util.js index f653b26..f245774 100644 --- a/src/common/util.js +++ b/src/common/util.js @@ -23,6 +23,9 @@ export function request(options) { url: apiurl + options.url, method: options.method || 'GET', data: options.data, + // #ifdef APP-PLUS + sslVerify: false, + // #endif header: { 'Platform': 2, 'Authorization': token, diff --git a/src/main.js b/src/main.js index 601a5df..d3028a2 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,25 @@ import VueI18n from '@/common/vue-i18n.min.js'; import lang_zh_CN from '@/common/locales/zh_CN.js'; import lang_en from '@/common/locales/en.js'; +// #ifdef APP-PLUS +// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,全局关闭 HTTPS 证书校验 +(() => { + const patchSslVerify = (methodName) => { + const original = uni[methodName]; + if (typeof original !== 'function') { + return; + } + uni[methodName] = (options = {}) => original({ + ...options, + sslVerify: false + }); + }; + patchSslVerify('request'); + patchSslVerify('downloadFile'); + patchSslVerify('uploadFile'); +})(); +// #endif + Vue.config.productionTip = false; App.mpType = 'app'; diff --git a/src/store/index.js b/src/store/index.js index c5b7493..86ced4a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -161,6 +161,9 @@ const store = new Vuex.Store({ uni.request({ url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList", method: "GET", + // #ifdef APP-PLUS + sslVerify: false, + // #endif header: { platform: "2", Authorization: uni.getStorageSync("RemoteTokenData").token,