From 906947359f119694ef4742884d0f37440c8027c9 Mon Sep 17 00:00:00 2001 From: lyp Date: Thu, 17 Apr 2025 08:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=8A=A0=E5=85=A5Co?= =?UTF-8?q?ntent-Type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/request.ts | 85 ++++++++++++++++++++++++++++++--------- src/route/index/Index.tsx | 6 +-- 2 files changed, 68 insertions(+), 23 deletions(-) diff --git a/src/request/request.ts b/src/request/request.ts index e34ce07..41d6487 100644 --- a/src/request/request.ts +++ b/src/request/request.ts @@ -9,7 +9,7 @@ import { } from '../util/AjaxUtils' -// 开发环境 +// // 开发环境 // const operatorPluginBaseUrl = 'http://192.168.0.115:8099' //开票 // const aiShopBaseUrl = 'http://192.168.0.115:8081'//买卖' // const operatorBaseUrl = 'http://192.168.0.15:8091' //绑定手机号 @@ -27,8 +27,27 @@ request.interceptors.request.use( config.headers = config.headers || {} config.headers['Auth'] = token ? `Bearer ${token}` : ''; config.headers['Content-Type'] = 'application/json'; - config.data = { unused: 0 } - + // config.data = { unused: 0 } + if (config.method === 'get' ) { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'put') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'post') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'delete') { + if (!config.data) { + config.data = { unused: 0 } + } + } return config; }, @@ -57,22 +76,27 @@ aiShopRequest.interceptors.request.use( config.headers = config.headers || {} config.headers['Auth'] = token ? `Bearer ${token}` : ''; config.headers['Content-Type'] = 'application/json'; - config.data = { unused: 0 } - // if (config.method === 'get' ) { - // if (!config.data) { - // config.data = { unused: 0 } - // } - // } - // if (config.method === 'put') { - // if (!config.data) { - // config.data = { unused: 0 } - // } - // } - // if (config.method === 'post') { - // if (!config.data) { - // config.data = { unused: 0 } - // } - // } + // config.data = { unused: 0 } + if (config.method === 'get' ) { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'put') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'post') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'delete') { + if (!config.data) { + config.data = { unused: 0 } + } + } return config; }, @@ -99,7 +123,28 @@ phoneRequest.interceptors.request.use( config.headers = config.headers || {} config.headers['Auth'] = token ? `Bearer ${token}` : ''; config.headers['Content-Type'] = 'application/json'; - config.data = { unused: 0 } + // config.data = { unused: 0 } + if (config.method === 'get' ) { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'put') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'post') { + if (!config.data) { + config.data = { unused: 0 } + } + } + if (config.method === 'delete') { + if (!config.data) { + config.data = { unused: 0 } + } + } + return config; }, diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index 42f724c..8237c0b 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -17,7 +17,7 @@ import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx"; import RefunModal from '../../components/RefunModal/RefunModal.tsx' import CorrectionModal from '../../components/CorrectionModal/CorrectionModal.tsx' import ContractModal from '../../components/ContractModal/ContractModal.tsx' -// import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' +import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' // import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; // import ListProj from "../../components/list/ListProj.tsx"; // import ListProjAgent from "../../components/list/ListProjAgent.tsx"; @@ -1699,7 +1699,7 @@ export default function Index() { list={agentMenu.list} handleListItem={agentMenu.handleListItem} /> */} - {/* */} + /> {/*