feat: support specific default api version now (#57)

This commit is contained in:
JustSong
2023-05-13 12:53:57 +08:00
parent 74c1ba7cbc
commit 83e86b9f8a
4 changed files with 18 additions and 2 deletions

View File

@@ -65,6 +65,9 @@ func Distribute() func(c *gin.Context) {
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
if channel.Type == common.ChannelTypeCustom || channel.Type == common.ChannelTypeAzure {
c.Set("base_url", channel.BaseURL)
if channel.Type == common.ChannelTypeAzure {
c.Set("api_version", channel.Other)
}
}
c.Next()
}