Skip to content

Commit 7c060c0

Browse files
committed
api: csrf token
1 parent 6b1e913 commit 7c060c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

service/bot/api_handler.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,3 +529,12 @@ func GetCookiesWithDomain(c *client.QQClient, domain string) string
529529
func HandleGetCookies(cli *client.QQClient, req *onebot.GetCookiesReq) *onebot.GetCookiesResp {
530530
return &onebot.GetCookiesResp{Cookies: GetCookiesWithDomain(cli, req.Domain)}
531531
}
532+
533+
//go:linkname GetCSRFToken github.com/Mrs4s/MiraiGo/client.(*QQClient).getCSRFToken
534+
func GetCSRFToken(c *client.QQClient) int
535+
536+
func HandleGetCSRFToken(cli *client.QQClient, req *onebot.GetCsrfTokenReq) *onebot.GetCsrfTokenResp {
537+
return &onebot.GetCsrfTokenResp{
538+
Token: int32(GetCSRFToken(cli)),
539+
}
540+
}

0 commit comments

Comments
 (0)