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) => {