fix: 关闭App端SSL校验以兼容老PDA

This commit is contained in:
2026-10-06 17:53:21 +08:00
parent 4faf1bf41a
commit d9d1458b58
4 changed files with 32 additions and 0 deletions
+7
View File
@@ -34,6 +34,10 @@ const install = (Vue, vm) => {
data: req.data, data: req.data,
header: req.header header: req.header
}, null, 2)); }, null, 2));
// #ifdef APP-PLUS
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,关闭校验证书
req.sslVerify = false;
// #endif
if (!req.header){ if (!req.header){
req.header = []; req.header = [];
} }
@@ -176,6 +180,9 @@ const install = (Vue, vm) => {
uni.request({ uni.request({
url, url,
method: 'PUT', method: 'PUT',
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
...header, ...header,
'Platform': 2, 'Platform': 2,
+3
View File
@@ -23,6 +23,9 @@ export function request(options) {
url: apiurl + options.url, url: apiurl + options.url,
method: options.method || 'GET', method: options.method || 'GET',
data: options.data, data: options.data,
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
'Platform': 2, 'Platform': 2,
'Authorization': token, 'Authorization': token,
+19
View File
@@ -17,6 +17,25 @@ import VueI18n from '@/common/vue-i18n.min.js';
import lang_zh_CN from '@/common/locales/zh_CN.js'; import lang_zh_CN from '@/common/locales/zh_CN.js';
import lang_en from '@/common/locales/en.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; Vue.config.productionTip = false;
App.mpType = 'app'; App.mpType = 'app';
+3
View File
@@ -174,6 +174,9 @@ const store = new Vuex.Store({
uni.request({ uni.request({
url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList", url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList",
method: "GET", method: "GET",
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
platform: "2", platform: "2",
Authorization: uni.getStorageSync("RemoteTokenData").token, Authorization: uni.getStorageSync("RemoteTokenData").token,