diff --git a/request/wrapper.go b/request/wrapper.go index c82000f..1cdc62a 100644 --- a/request/wrapper.go +++ b/request/wrapper.go @@ -62,6 +62,18 @@ func (wh *wrapperHandle) GetUri(ctx *gin.Context, defaultVal string) string { return defaultVal } +// GetScheme 获取scheme +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 16:16 2024/1/2 +func (wh *wrapperHandle) GetScheme(ctx *gin.Context, defaultVal string) string { + if nil != ctx && nil != ctx.Request && nil != ctx.Request.URL { + return ctx.Request.URL.Scheme + } + return defaultVal +} + // GetQuery 获取query参数 // // Author : go_developer@163.com<白茶清欢>