From f2e5fb7e0e7ec77fd1634ad7c0626e41e54f3ebc Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Tue, 16 May 2023 13:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E6=94=B9=E4=B8=BA=20POST?= =?UTF-8?q?=EF=BC=9B=E8=B0=83=E6=95=B4=E4=BE=9B=E5=BA=94=E5=95=86=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 16 ++++++++-------- src/views/App.jsx | 4 ++-- src/views/reservation/Newest.jsx | 19 +++---------------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index a8d14e7..e4ea272 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -1,5 +1,5 @@ import { makeAutoObservable, runInAction } from "mobx"; -import { fetchJSON } from '@/utils/request'; +import { fetchJSON, postForm } from '@/utils/request'; import { HT_HOST } from "@/config"; import { prepareUrl } from '@/utils/commons'; @@ -10,13 +10,13 @@ class Auth { this.root = root; } - valdateUserPassword(usr, pwd) { - const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/Login') - .append('username', usr) - .append('password', pwd) - .build(); + valdateUserPassword(usr, pwd) { + const formData = new FormData(); + formData.append('username', usr); + formData.append('Password', pwd); + const postUrl = HT_HOST + '/service-CooperateSOA/Login'; - return fetchJSON(fetchUrl) + return postForm(postUrl, formData) .then(json => { if (json.errcode == 0) { return json.Result.WU_LMI_SN; @@ -27,7 +27,7 @@ class Auth { } fetchUserDetail(userId) { - const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/GetLinkManInfo') + const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo') .append('LMI_SN', userId) .build(); diff --git a/src/views/App.jsx b/src/views/App.jsx index 4265117..e85bd06 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -62,7 +62,7 @@ function App() { }}>
- + App logo @@ -78,7 +78,7 @@ function App() { ]} /> - + {authStore.login.travelAgencyName} diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 795e694..de735c7 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -93,7 +93,8 @@ function Newest() { const arrivalDateFrom = dayjs().startOf("M"); const arrivalDateThru = dayjs().endOf("M"); - const [arrivalDateRange, onDateRangeChange] = useState([arrivalDateFrom, arrivalDateThru]); + const [arrivalDateRange, onDateRangeChange] = + useState([arrivalDateFrom.format('YYYY-MM-DD'), arrivalDateThru.format('YYYY-MM-DD')]); const [referenceNo, onNumberChange] = useState(''); const [dataLoading, setDataLoading] = useState(false); const { notification } = App.useApp(); @@ -106,21 +107,7 @@ function Newest() { }); useEffect(() => { - setDataLoading(true); - reservationStore.fetchReservationList( - 1, referenceNo, - arrivalDateRange[0].format('YYYY-MM-DD'), arrivalDateRange[1].format('YYYY-MM-DD')) - .catch(ex => { - notification.error({ - message: `Notification`, - description: ex.message, - placement: 'top', - duration: 4, - }); - }) - .finally(() => { - setDataLoading(false); - }); + onSearchClick(); }, []); const showCityGuideModal = (reservation) => {