From c9070a661cab9aa93abbf0300cb383db44629d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E7=8E=89=E7=90=B3?= <1584592841@qq.com> Date: Thu, 21 Jul 2022 15:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 2 +- src/components/WareClerk/GoodsIn.jsx | 3 +++ src/components/WareClerk/WareChange.jsx | 3 +++ src/utils/adminRequest.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 708657a..8d0f798 100644 --- a/src/App.js +++ b/src/App.js @@ -3,7 +3,7 @@ import { LoginReg, NotFoundPage, Admin } from "./pages"; import { Into, Login } from "./userPages/index"; import axios from "axios"; -// axios.defaults.baseURL = "http://localhost:80"; +axios.defaults.baseURL = "http://localhost:80"; axios.interceptors.request.use((config) => { // console.log(config); diff --git a/src/components/WareClerk/GoodsIn.jsx b/src/components/WareClerk/GoodsIn.jsx index e2c1868..f7017c5 100644 --- a/src/components/WareClerk/GoodsIn.jsx +++ b/src/components/WareClerk/GoodsIn.jsx @@ -218,6 +218,9 @@ const GoodsIn = () => { //所有仓位 useEffect(() => { + if(!repositoryList.length){ + return; + } let resObj = {}; for (let repo of repositoryList) { Object.assign(resObj, { diff --git a/src/components/WareClerk/WareChange.jsx b/src/components/WareClerk/WareChange.jsx index 4b37bbd..7994241 100644 --- a/src/components/WareClerk/WareChange.jsx +++ b/src/components/WareClerk/WareChange.jsx @@ -181,6 +181,9 @@ const WareChange = () => { //所有仓位 useEffect(() => { + if(!repositoryList.length){ + return; + } let resObj = {}; for (let repo of repositoryList) { Object.assign(resObj, { diff --git a/src/utils/adminRequest.js b/src/utils/adminRequest.js index a0356e9..953ccbb 100644 --- a/src/utils/adminRequest.js +++ b/src/utils/adminRequest.js @@ -1,5 +1,5 @@ import axios from "axios"; -axios.defaults.baseURL = "http://localhost:8088"; +// axios.defaults.baseURL = "http://localhost:8088"; const adminRequest = axios.create(); adminRequest.interceptors.request.use((config) => { -- Gitee