feat: add token name to log (#172)

* add token name to log

* chore: update expression

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
Miniers
2023-06-17 14:56:03 +08:00
committed by GitHub
parent 6dcffca065
commit 46c43396d8
2 changed files with 3 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ func TokenAuth() func(c *gin.Context) {
}
c.Set("id", token.UserId)
c.Set("token_id", token.Id)
c.Set("token_name", token.Name)
requestURL := c.Request.URL.String()
consumeQuota := true
if strings.HasPrefix(requestURL, "/v1/models") {