From 82f5200bc3be966a6c91b29fb277bd98706a47f5 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Tue, 30 Nov 2021 01:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=86=E9=94=80=E5=95=86bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 2 ++ src/pages/distributor/add/add.js | 5 +++-- .../distributor/adddistributorinfo/adddistributorinfo.js | 6 ++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 7fb65ffa..fa0c304a 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -163,6 +163,8 @@ export const handelResponse = (res, cb, errCb) => { cb(res.data, res.message) } else { if (res&&typeof errCb == 'function') { + Notify.clear(); + Notify.error(res.message); errCb(res.message) } } diff --git a/src/pages/distributor/add/add.js b/src/pages/distributor/add/add.js index 22027d1c..c8544ef4 100644 --- a/src/pages/distributor/add/add.js +++ b/src/pages/distributor/add/add.js @@ -72,7 +72,8 @@ export default class acclist extends React.Component{ window.history.back() },1000); },(err)=>{ - + Notify.clear(); + Notify.error(err); }) }).catch(err=>{ }); @@ -89,7 +90,7 @@ export default class acclist extends React.Component{ window.history.back() },1000); },(err)=>{ - + }) }).catch(err=>{ }); diff --git a/src/pages/distributor/adddistributorinfo/adddistributorinfo.js b/src/pages/distributor/adddistributorinfo/adddistributorinfo.js index 1dff2612..f7e9faca 100644 --- a/src/pages/distributor/adddistributorinfo/adddistributorinfo.js +++ b/src/pages/distributor/adddistributorinfo/adddistributorinfo.js @@ -200,8 +200,7 @@ export default class adduserinfo extends React.Component{ NameblurFn(e){ getExistName(e).then(res=>{ handelResponse(res,(response,msg)=>{ - Notify.clear(); - Notify.success(msg); + },err=>{ Notify.clear(); Notify.error(res.data.message); @@ -215,8 +214,7 @@ export default class adduserinfo extends React.Component{ AccountblurFn(e){ getExistAccount(e).then(res=>{ handelResponse(res,(response,msg)=>{ - Notify.clear(); - Notify.success(msg); + },err=>{ Notify.clear(); Notify.error(res.data.message);