From 93c10ced7a82fa1a764a52fac99594699bd7a54f Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 02 Jul 2024 10:48:28 +0800
Subject: [PATCH] 优化请求提示

---
 bases/Fetcher.js |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bases/Fetcher.js b/bases/Fetcher.js
index 4fd1e10..54a41c8 100644
--- a/bases/Fetcher.js
+++ b/bases/Fetcher.js
@@ -125,7 +125,7 @@
      * @param {String} url
      * @param {*} [data]
      * @param {object} [options]
-     * @return {Promise<any>|}
+     * @return {Promise<any>}
      */
     query(type, url, data = null, options = {}) {
         return new Promise((resolve, reject) => {
@@ -150,8 +150,8 @@
                     // 捕获响应
                     options && options.onCapture && options.onCapture({
                         url: this._createUrlPrefix(options) + url,
-                        request: JSON.stringify(data),
-                        response: JSON.stringify(response.data),
+                        request: data,
+                        response: { ...response.data },
                         httpCode: response.statusCode,
                     });
                     /**
@@ -173,7 +173,7 @@
                         // 捕获响应
                         options && options.onCapture && options.onCapture({
                             url: this._createUrlPrefix(options) + url,
-                            request: JSON.stringify(data),
+                            request: data,
                             httpCode: error && error.status,
                             httpMsg: msg + (error.message ? (' / ' + error.message) : ''),
                         });
@@ -590,7 +590,7 @@
             title: msg,
             icon: 'none',
             mask: false,
-            duration: type === 'fail' ? 3000 : 2000,
+            duration: (type === 'fail' || type === 'error') ? 3000 : 2000,
         });
     }
 

--
Gitblit v1.9.1