Support custom channel now

This commit is contained in:
JustSong committed 2023-04-23 20:35:49 +08:00
1 parent 17deb964ab
commit 32755d875a
8 files changed
+55 -8

No files matched your search

+3
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()
}
}