diff --git a/base/cli/system.go b/base/cli/system.go index 0632313b..45b44090 100644 --- a/base/cli/system.go +++ b/base/cli/system.go @@ -209,7 +209,10 @@ func init() { }}, }) ice.Info.SystemCmd = func(m *ice.Message, arg ...ice.Any) *ice.Message { - return m.Cmd(append([]ice.Any{SYSTEM}, arg...)...) + msg := m.Cmd(append([]ice.Any{SYSTEM}, arg...)...) + if m.Warn(!IsSuccess(msg), msg.Append(CMD_ERR)) { + } + return msg } } diff --git a/base/web/toast.go b/base/web/toast.go index 882efdae..54508009 100644 --- a/base/web/toast.go +++ b/base/web/toast.go @@ -71,6 +71,9 @@ func ToastProcess(m *ice.Message, arg ...ice.Any) func(...ice.Any) { Toast(m, text, "", "-1", "", h) Count(m, kit.FuncName(1), toastTitle(m), text) return func(_arg ...ice.Any) { + if m.IsErr() { + return + } kit.If(len(_arg) == 0, func() { _arg = arg }) text := toastContent(m, ice.SUCCESS, _arg...) toastUpdate(m, h, begin, mdb.TEXT, text, mdb.STATUS, TOAST_DONE) diff --git a/misc/wx/access.go b/misc/wx/access.go index c97b13ed..aa135d39 100644 --- a/misc/wx/access.go +++ b/misc/wx/access.go @@ -165,11 +165,13 @@ func spidePost(m *ice.Message, api string, arg ...ice.Any) *ice.Message { } func SpidePost(m *ice.Message, api string, arg ...ice.Any) ice.Any { res := kit.UnMarshal(m.Cmdx(web.SPIDE, WX, web.SPIDE_RAW, http.MethodPost, kit.MergeURL(api, oauth.ACCESS_TOKEN, m.Cmdx(ACCESS, TOKENS)), arg)) + m.Warn(!kit.IsIn(kit.Format(kit.Value(res, "errcode")), "", "0"), kit.Value(res, "errmsg")) m.Info("res: %v", kit.Format(res)) return res } func SpideGet(m *ice.Message, api string, arg ...ice.Any) ice.Any { res := kit.UnMarshal(m.Cmdx(web.SPIDE, WX, web.SPIDE_RAW, http.MethodGet, kit.MergeURL(api, oauth.ACCESS_TOKEN, m.Cmdx(ACCESS, TOKENS)), arg)) + m.Warn(!kit.IsIn(kit.Format(kit.Value(res, "errcode")), "", "0"), kit.Value(res, "errmsg")) m.Info("res: %v", kit.Format(res)) return res }