Support custom channel now

This commit is contained in:
JustSong
2023-04-23 20:35:49 +08:00
parent 57379d8e92
commit b3be4d8f85
8 changed files with 55 additions and 8 deletions

View File

@@ -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()
}
}