forked from x/icebergs
add some
This commit is contained in:
parent
af1a9be68e
commit
e29a4fa6b8
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user