Skip to content

Commit c526fb6

Browse files
committed
fix: 修复bug
1 parent 7269d68 commit c526fb6

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
AppName = "QuarkGo"
2323

2424
// 版本号
25-
Version = "3.8.10"
25+
Version = "3.8.11"
2626

2727
// 包名
2828
PkgName = "github.com/quarkcloudio/quark-go/v3"

message.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ type Message struct {
77
}
88

99
type ComponentMessage struct {
10-
Type string `json:"type"`
11-
Content interface{} `json:"content"`
12-
Duration int `json:"duration"`
13-
Icon string `json:"icon"`
14-
Data interface{} `json:"data"`
15-
Url string `json:"url"`
10+
Component string `json:"component"`
11+
Type string `json:"type"`
12+
Content interface{} `json:"content"`
13+
Duration int `json:"duration"`
14+
Icon string `json:"icon"`
15+
Data interface{} `json:"data"`
16+
Url string `json:"url"`
1617
}
1718

1819
type CodeMap struct {
@@ -120,9 +121,10 @@ func ComponentSuccess(params ...interface{}) *ComponentMessage {
120121
}
121122

122123
return &ComponentMessage{
123-
Type: "success",
124-
Content: content,
125-
Data: data,
124+
Component: "message",
125+
Type: "success",
126+
Content: content,
127+
Data: data,
126128
}
127129
}
128130

@@ -141,9 +143,10 @@ func ComponentError(params ...interface{}) *ComponentMessage {
141143
}
142144

143145
return &ComponentMessage{
144-
Type: "error",
145-
Content: content,
146-
Data: data,
146+
Component: "message",
147+
Type: "error",
148+
Content: content,
149+
Data: data,
147150
}
148151
}
149152

@@ -164,9 +167,10 @@ func ComponentErrorByCode(params ...interface{}) *ComponentMessage {
164167
content = GetMsgByCode(code)
165168

166169
return &ComponentMessage{
167-
Type: "error",
168-
Content: content,
169-
Data: data,
170+
Component: "message",
171+
Type: "error",
172+
Content: content,
173+
Data: data,
170174
}
171175
}
172176

@@ -191,8 +195,9 @@ func ComponentRedirectTo(params ...interface{}) *ComponentMessage {
191195
}
192196

193197
return &ComponentMessage{
194-
Type: msgType,
195-
Content: content,
196-
Url: url,
198+
Component: "message",
199+
Type: msgType,
200+
Content: content,
201+
Url: url,
197202
}
198203
}

0 commit comments

Comments
 (0)