From d82fcfe136fbe96150167e1be6d5221408be6c64 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Fri, 26 Jan 2024 11:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E5=87=BA?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{views => components}/ErrorPage.jsx | 5 +++-- src/main.jsx | 2 +- src/views/OrderFollow.jsx | 20 ++++++++++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) rename src/{views => components}/ErrorPage.jsx (66%) diff --git a/src/views/ErrorPage.jsx b/src/components/ErrorPage.jsx similarity index 66% rename from src/views/ErrorPage.jsx rename to src/components/ErrorPage.jsx index 76c9dfb..d99cd93 100644 --- a/src/views/ErrorPage.jsx +++ b/src/components/ErrorPage.jsx @@ -3,13 +3,14 @@ import { Card, Typography, Flex, Result, Button } from 'antd' export default function ErrorPage() { const errorResponse = useRouteError(); - console.error(errorResponse); + console.info('error: '); + console.dir(errorResponse.message); return ( ); } \ No newline at end of file diff --git a/src/main.jsx b/src/main.jsx index 4ae749d..679e0dc 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -13,7 +13,7 @@ import ChatHistory from '@/views/ChatHistory' import SalesManagement from '@/views/SalesManagement' import DingdingQRCode from '@/views/DingdingQRCode' import AccountProfile from '@/views/AccountProfile' -import ErrorPage from '@/views/ErrorPage' +import ErrorPage from '@/components/ErrorPage' import Conversations from '@/views/Conversations/ChatWindow' // import Conversations from '@/views/Conversations/ChatApp' diff --git a/src/views/OrderFollow.jsx b/src/views/OrderFollow.jsx index 941cd18..e8a83fb 100644 --- a/src/views/OrderFollow.jsx +++ b/src/views/OrderFollow.jsx @@ -1,7 +1,7 @@ import { memo, useCallback, useEffect, useState } from 'react' import { Badge, Divider, Table, Button, Input, - Space, Tag, Radio, Select, Flex, Form, Switch, DatePicker + Space, Tag, Radio, Select, Flex, Form, Switch, DatePicker, App } from 'antd' import { Conditional } from '@/components/Conditional' import { useAuthContext } from '@/stores/AuthContext' @@ -155,7 +155,7 @@ function OrderList({ formValues }) { key: 'COLI_Introduction', }, ] - + const { notification } = App.useApp() const [orderData, setOrderData] = useState([]) const [loading, setLoading] = useState(false) const { loginUser } = useAuthContext() @@ -167,11 +167,23 @@ function OrderList({ formValues }) { .then(json => { if (json.errcode === 0) { setOrderData([...json.result]) - setLoading(false) + } else { + notification.error({ + message: '查询出错', + description: json?.errmsg, + placement: 'top', + duration: 60, + }) } }) + .finally(() => setLoading(false)) .catch(reason => { - console.info(reason) + notification.error({ + message: '查询出错', + description: reason.message, + placement: 'top', + duration: 60, + }) }) }, [formValues])