From d84760d2031b792553374e732d9b6b2936575d25 Mon Sep 17 00:00:00 2001 From: j2rong4cn <253551464@qq.com> Date: Thu, 13 Jun 2024 20:57:48 +0800 Subject: [PATCH] refactor --- server/common/base.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/common/base.go b/server/common/base.go index b414344b413a..09f8f5810d49 100644 --- a/server/common/base.go +++ b/server/common/base.go @@ -32,9 +32,8 @@ func GetApiUrl(r *http.Request) string { } func GetApiUrlFromContext(ctx context.Context) string { - var r *http.Request if c, ok := ctx.(*gin.Context); ok { - r = c.Request + return GetApiUrl(c.Request) } - return GetApiUrl(r) + return GetApiUrl(nil) }