diff --git a/src/App.js b/src/App.js index 708657a927324fb26f2c61f25c6311f13413010b..8d0f79863adb7116e0a726b035e3719c59d3521d 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 e2c186872396cb835efbd4cf6eeaa33876151a8f..f7017c516efa6f8d4dbacdd76a1e1dbcc3308034 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 4b37bbd8892fa09faecb75a08dc47f76d6c32f34..7994241e156eec6c6e44866cb31e81c8dbc4674a 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 a0356e9391f6f60299ffd0ec920fdb922f4f61b9..953ccbb98516f0a60b5717048aa886942346f8fc 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) => {