1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-29 22:49:54 +08:00
parent af1a9be68e
commit e29a4fa6b8
3 changed files with 9 additions and 1 deletions

View File

@ -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
}
}

View File

@ -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)

View File

@ -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
}