huangbin 4 年之前
父節點
當前提交
96a8809b2d
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2 5
      src/common/methods/request/resultInfo.ts

+ 2 - 5
src/common/methods/request/resultInfo.ts

@@ -28,7 +28,7 @@ export function commonResultInfo(fn: Promise<any>, sign: ResultInfo, loading: Re
         return Promise.resolve(sign[0])
     })
         .catch((err: string) => {
-            console.warn(`${fn}调用失败: err`);
+            console.warn(`${fn}调用失败: ${err}`);
             message.error(sign[1] + err)
             return Promise.reject(sign[1] + err)
         }).finally(() => {
@@ -67,7 +67,7 @@ export function controlResultInfo(fn: Promise<any>, msgInfo: [string, string] =
         message.success(sucInfo)
         return res;
     }).catch(err => {
-        console.warn(`${fn}调用失败: err`);
+        console.warn(`${fn}调用失败: ${err}`);
         const result = errInfo + err
         message.error(result)
         Promise.reject(result)
@@ -109,9 +109,6 @@ export function controlResultErrInfo(fn: Promise<any>) {
  * @returns
  */
 export function requestResultLoadingAndInfo(fn: Function, param: any, loading: Ref<boolean>, messageInfo: [string, string] = ['成功', '失败']) {
-    const cacheFn = () => controlResultInfo(controlLoading(fn, loading, param), messageInfo)
-    // 防抖
-    // return debounce(cacheFn, 2000)
     return controlResultInfo(controlLoading(fn, loading, param), messageInfo)
 }