From ddf5c85b815ee37fbfb8b3a934a479317ac7eb57 Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Tue, 7 Oct 2025 14:13:14 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9D=A4=20fix(topup):=20prevent=20nil-pointer?= =?UTF-8?q?=20in=20Epay=20callback;=20reset=20page=20on=20search=20Add=20e?= =?UTF-8?q?arly=20return=20when=20Epay=20client=20is=20missing=20in=20cont?= =?UTF-8?q?roller/topup.go=20to=20avoid=20panic=20Introduce=20handleKeywor?= =?UTF-8?q?dChange=20in=20TopupHistoryModal.jsx=20to=20reset=20page=20to?= =?UTF-8?q?=201=20when=20keyword=20updates=20Wire=20input=20onChange=20to?= =?UTF-8?q?=20new=20handler;=20minor=20UX=20improvement=20to=20avoid=20emp?= =?UTF-8?q?ty=20results=20on=20pagination=20mismatch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/topup.go | 2 +- web/src/components/topup/modals/TopupHistoryModal.jsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/controller/topup.go b/controller/topup.go index 76a2521d9..62bc676da 100644 --- a/controller/topup.go +++ b/controller/topup.go @@ -237,8 +237,8 @@ func EpayNotify(c *gin.Context) { _, err := c.Writer.Write([]byte("fail")) if err != nil { log.Println("易支付回调写入失败") - return } + return } verifyInfo, err := client.Verify(params) if err == nil && verifyInfo.VerifyStatus { diff --git a/web/src/components/topup/modals/TopupHistoryModal.jsx b/web/src/components/topup/modals/TopupHistoryModal.jsx index 57916a9aa..12abfbd79 100644 --- a/web/src/components/topup/modals/TopupHistoryModal.jsx +++ b/web/src/components/topup/modals/TopupHistoryModal.jsx @@ -102,6 +102,11 @@ const TopupHistoryModal = ({ visible, onCancel, t }) => { setPage(1); }; + const handleKeywordChange = (value) => { + setKeyword(value); + setPage(1); + }; + // 管理员补单 const handleAdminComplete = async (tradeNo) => { try { @@ -231,7 +236,7 @@ const TopupHistoryModal = ({ visible, onCancel, t }) => { prefix={} placeholder={t('订单号')} value={keyword} - onChange={setKeyword} + onChange={handleKeywordChange} showClear />