Open the DingTalk link in browser (#17084)
https://developers.dingtalk.com/document/app/message-link-description To open the link in browser, we should use this URL: `"dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL)` Otherwise the page is displayed inside DingTalk client, it makes users very difficult to visit non-public URLs in DingTalk webhook messages.
This commit is contained in:
parent
ea207f694d
commit
6532aa2ed3
2 changed files with 28 additions and 13 deletions
|
@ -6,6 +6,7 @@ package webhook
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
|
@ -175,7 +176,10 @@ func createDingtalkPayload(title, text, singleTitle, singleURL string) *Dingtalk
|
|||
Title: strings.TrimSpace(title),
|
||||
HideAvatar: "0",
|
||||
SingleTitle: singleTitle,
|
||||
SingleURL: singleURL,
|
||||
|
||||
// https://developers.dingtalk.com/document/app/message-link-description
|
||||
// to open the link in browser, we should use this URL, otherwise the page is displayed inside DingTalk client, very difficult to visit non-public URLs.
|
||||
SingleURL: "dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue