Просмотр исходного кода

❤ fix(topup): prevent nil-pointer in Epay callback; reset page on search
Add early return when Epay client is missing in controller/topup.go to avoid panic
Introduce handleKeywordChange in TopupHistoryModal.jsx to reset page to 1 when keyword updates
Wire input onChange to new handler; minor UX improvement to avoid empty results on pagination mismatch

Apple\Apple 2 месяцев назад
Родитель
Сommit
ddf5c85b81
2 измененных файлов с 7 добавлено и 2 удалено
  1. 1 1
      controller/topup.go
  2. 6 1
      web/src/components/topup/modals/TopupHistoryModal.jsx

+ 1 - 1
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 {

+ 6 - 1
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={<IconSearch />}
           placeholder={t('订单号')}
           value={keyword}
-          onChange={setKeyword}
+          onChange={handleKeywordChange}
           showClear
         />
       </div>