From f968d773654564483c02f1d52ce008bae7341b0a Mon Sep 17 00:00:00 2001 From: creamlike1024 Date: Fri, 25 Apr 2025 17:08:26 +0800 Subject: [PATCH] fix: remove apikey from test channel log, close #1000 --- controller/channel-test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index 99ba04b0..d1cb4093 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -103,7 +103,10 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr } request := buildTestRequest(testModel) - common.SysLog(fmt.Sprintf("testing channel %d with model %s , info %v ", channel.Id, testModel, info)) + // 创建一个用于日志的 info 副本,移除 ApiKey + logInfo := *info + logInfo.ApiKey = "" + common.SysLog(fmt.Sprintf("testing channel %d with model %s , info %+v ", channel.Id, testModel, logInfo)) priceData, err := helper.ModelPriceHelper(c, info, 0, int(request.MaxTokens)) if err != nil {