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 {
|
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)
|
Toast(m, text, "", "-1", "", h)
|
||||||
Count(m, kit.FuncName(1), toastTitle(m), text)
|
Count(m, kit.FuncName(1), toastTitle(m), text)
|
||||||
return func(_arg ...ice.Any) {
|
return func(_arg ...ice.Any) {
|
||||||
|
if m.IsErr() {
|
||||||
|
return
|
||||||
|
}
|
||||||
kit.If(len(_arg) == 0, func() { _arg = arg })
|
kit.If(len(_arg) == 0, func() { _arg = arg })
|
||||||
text := toastContent(m, ice.SUCCESS, _arg...)
|
text := toastContent(m, ice.SUCCESS, _arg...)
|
||||||
toastUpdate(m, h, begin, mdb.TEXT, text, mdb.STATUS, TOAST_DONE)
|
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 {
|
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))
|
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))
|
m.Info("res: %v", kit.Format(res))
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
func SpideGet(m *ice.Message, api string, arg ...ice.Any) ice.Any {
|
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))
|
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))
|
m.Info("res: %v", kit.Format(res))
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user