From aec343dc387111eee9728c10d733da84b832d3cc Mon Sep 17 00:00:00 2001 From: MaricoHan <92877246+MaricoHan@users.noreply.github.com> Date: Sun, 29 Oct 2023 22:03:01 +0800 Subject: [PATCH] feat: support xunfei v3 (#637) --- controller/relay-xunfei.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/relay-xunfei.go b/controller/relay-xunfei.go index cbaf38feeb..91fb6042bb 100644 --- a/controller/relay-xunfei.go +++ b/controller/relay-xunfei.go @@ -298,8 +298,8 @@ func getXunfeiAuthUrl(c *gin.Context, apiKey string, apiSecret string) (string, common.SysLog("api_version not found, use default: " + apiVersion) } domain := "general" - if apiVersion == "v2.1" { - domain = "generalv2" + if apiVersion != "v1.1" { + domain += strings.Split(apiVersion, ".")[0] } authUrl := buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret) return domain, authUrl