Skip to content

Commit

Permalink
fix: 修复返回图片异常
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Mar 19, 2024
1 parent e73c462 commit f47ed32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions wclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ type ApiCallbackData struct {
}
```

```json
{
"type": "image",
"link": "图片链接"
}
```

```json
{
"type": "text",
Expand Down
3 changes: 2 additions & 1 deletion wclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func ApiRequestMsg(url, wxid, roomid string) int32 {
"User-Agent": args.AppName + "/" + args.Version,
"Client-Uid": self.Wxid + "," + wxid,
})

if err != nil {
if res == "" {
res = err.Error()
Expand Down Expand Up @@ -179,7 +180,7 @@ type ApiResponse struct {
Link string `json:"link"` // 点击后跳转的链接
Icon string `json:"icon"` // 右侧缩略图的链接,可选
} `json:"card,omitempty"`
Link string `json:"file,omitempty"` // 当 type 为 file 或 image 时有效
Link string `json:"link,omitempty"` // 当 type 为 file 或 image 时有效
Text string `json:"text,omitempty"` // 当 type 为 text 或 error 时有效
}

Expand Down

0 comments on commit f47ed32

Please sign in to comment.