From 29515dab9daab8b957a5700376c926e0ac42fa76 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Tue, 14 Apr 2026 09:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=80=BB=E9=83=A8=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E7=BB=84=E7=BB=87=E7=BB=93=E6=9E=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index eb86aa0..2edf1aa 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -109,6 +109,7 @@ export function getRequestHeaders(url, type = 'post', data, isIgnoreTenant) { if (Tenant && Tenant == '003' && data && data.Parameter22 && data.Parameter22.length > 20) { //总公司 Parameter22 存入子公司的ORG_ID 自动切换数据库链接 headers.Tenant = data.Parameter22.substring(0, 3) + data.IgnoreDataRule = true } return headers @@ -130,17 +131,20 @@ export function httpPost(url, data, onlyData = true, ignoreThrottle, onException // 与 isIgnoreTenant 相关配套的逻辑 const extraData = isIgnoreTenant ? { OrgId: '', IgnoreOrgRule: true } : {} //const dataStr = JSON.stringify(Object.assign({}, data, { DataRule, OrgRule, ...extraData })) + var headers = getRequestHeaders(url, 'post', data, isIgnoreTenant) + if (headers.Tenant == '003') { + data.IgnoreDataRule = true + } const dataStr = JSON.stringify(Object.assign({}, data, { OrgRule, ...extraData })) // 请求节流 const requestKey = url + '_' + MD5(dataStr) + '_requestKey' const loaded = storage('lacal').getItem(requestKey).val if (loaded && !ignoreThrottle) return null storage('lacal').setItem(requestKey, true) - // 发起请求 return request(url, { method: 'POST', - headers: getRequestHeaders(url, 'post', data, isIgnoreTenant), + headers: headers,// getRequestHeaders(url, 'post', data, isIgnoreTenant), body: dataStr, }, onlyData, requestKey, onException) } @@ -158,8 +162,12 @@ export function httpGet(url, data, onlyData = true, onException) { const searchMark = url.indexOf('?') !== -1 const formUrl = `${url}${searchMark ? '&' : '?'}${formParams}` url = formParams ? formUrl : url + var headers = getRequestHeaders(url, 'get', data) + if (headers.Tenant == '003') { + data.IgnoreDataRule = true + } return request(url, { method: 'GET', - headers: getRequestHeaders(url, 'get', data), + headers: headers,// getRequestHeaders(url, 'get', data), }, onlyData, null, onException) }