Commit 46326b47 by MaricoHan Committed by GitHub

feat: support xunfei v3 (#637)

parent 0e4f9e46
...@@ -298,8 +298,8 @@ func getXunfeiAuthUrl(c *gin.Context, apiKey string, apiSecret string) (string, ...@@ -298,8 +298,8 @@ func getXunfeiAuthUrl(c *gin.Context, apiKey string, apiSecret string) (string,
common.SysLog("api_version not found, use default: " + apiVersion) common.SysLog("api_version not found, use default: " + apiVersion)
} }
domain := "general" domain := "general"
if apiVersion == "v2.1" { if apiVersion != "v1.1" {
domain = "generalv2" domain += strings.Split(apiVersion, ".")[0]
} }
authUrl := buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret) authUrl := buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret)
return domain, authUrl return domain, authUrl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment