mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 提供消息提示推送 API 接口 https://github.com/siyuan-note/siyuan/issues/5102
This commit is contained in:
parent
e4219bf679
commit
5779dcb151
3 changed files with 72 additions and 6 deletions
|
|
@ -127,14 +127,16 @@ func PushTxErr(msg string, code int, data interface{}) {
|
|||
BroadcastByType("main", "txerr", code, msg, data)
|
||||
}
|
||||
|
||||
func PushMsg(msg string, timeout int) string {
|
||||
ret := gulu.Rand.String(7)
|
||||
BroadcastByType("main", "msg", 0, msg, map[string]interface{}{"id": ret, "closeTimeout": timeout})
|
||||
return ret
|
||||
func PushMsg(msg string, timeout int) (msgId string) {
|
||||
msgId = gulu.Rand.String(7)
|
||||
BroadcastByType("main", "msg", 0, msg, map[string]interface{}{"id": msgId, "closeTimeout": timeout})
|
||||
return
|
||||
}
|
||||
|
||||
func PushErrMsg(msg string, timeout int) {
|
||||
BroadcastByType("main", "msg", -1, msg, map[string]interface{}{"closeTimeout": timeout})
|
||||
func PushErrMsg(msg string, timeout int) (msgId string) {
|
||||
msgId = gulu.Rand.String(7)
|
||||
BroadcastByType("main", "msg", -1, msg, map[string]interface{}{"id": msgId, "closeTimeout": timeout})
|
||||
return
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue