Ver Fonte

【bug】修改服务器返回报错问题

mojunshou há 7 meses atrás
pai
commit
36b88308b2

+ 1 - 1
assets/script/game/common/manager/ProtocolEvent.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-29 18:40:25
+ * @LastEditTime: 2025-04-29 18:52:06
  * @Description: 消息定义
  */
 

+ 4 - 3
assets/script/game/common/manager/ServerHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:16:41
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-29 18:39:46
+ * @LastEditTime: 2025-04-29 18:59:59
  * @Description: 
  */
 // ServerHandler.ts
@@ -121,7 +121,7 @@ export class ServerHandler {
     getHbTxInfo() {
         const param = {
             url: ProtocolEvent.GetHbWithdrawInfo,
-            callback: this.buildCallback('ServerHandler.inst.onHbTxInfo', 'ServerHandler.instonRequestFail')
+            callback: this.buildCallback('ServerHandler.inst.onHbTxInfo', 'ServerHandler.inst.onRequestFail')
         };
         this.sendMsgToServer(param);
     }
@@ -145,7 +145,7 @@ export class ServerHandler {
     getUserItemInfo() {
         const param = {
             url: ProtocolEvent.UserItemInfo,
-            callback: this.buildCallback('ServerHandler.inst.onUserItemInfo', 'ServerHandler.instonRequestFail')
+            callback: this.buildCallback('ServerHandler.inst.onUserItemInfo', 'ServerHandler.inst.onRequestFail')
         };
         this.sendMsgToServer(param);
     }
@@ -598,6 +598,7 @@ export class ServerHandler {
 
     onRequestFail(code: number, str: string) {
         console.log('[服务器] 请求失败', code, str);
+        oops.gui.toast("网络错误,请稍后重试~")
     }
 
 }