🎨 Change the method of getting channel parameters

This commit is contained in:
Martial BE
2023-12-26 16:40:50 +08:00
parent 47b72b850f
commit eeb867da10
34 changed files with 67 additions and 120 deletions

View File

@@ -32,9 +32,9 @@ type AliProvider struct {
func (p *AliProvider) GetRequestHeaders() (headers map[string]string) {
headers = make(map[string]string)
p.CommonRequestHeaders(headers)
headers["Authorization"] = fmt.Sprintf("Bearer %s", p.Context.GetString("api_key"))
if p.Context.GetString("plugin") != "" {
headers["X-DashScope-Plugin"] = p.Context.GetString("plugin")
headers["Authorization"] = fmt.Sprintf("Bearer %s", p.Channel.Key)
if p.Channel.Other != "" {
headers["X-DashScope-Plugin"] = p.Channel.Other
}
return headers