mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-14 06:20:27 +00:00
Support custom channel now
This commit is contained in:
@@ -63,6 +63,9 @@ func Distribute() func(c *gin.Context) {
|
||||
}
|
||||
c.Set("channel", channel.Type)
|
||||
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
|
||||
if channel.Type == common.ChannelTypeCustom {
|
||||
c.Set("base_url", channel.BaseURL)
|
||||
}
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user