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

This commit is contained in:
JustSong
2023-05-13 12:53:57 +08:00
parent 6c2e1aab65
commit 9ed9eaa65f
4 changed files with 18 additions and 2 deletions
+3
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()
}