增加GetDomain方法
This commit is contained in:
@ -121,6 +121,18 @@ func (wh *wrapperHandle) GetContentType(ctx *gin.Context, defaultVal string) str
|
||||
return wrapper.TernaryOperator.String(len(contentType) > 0, wrapper.String(contentType), wrapper.String(defaultVal)).Value()
|
||||
}
|
||||
|
||||
// GetDomain 获取请求Domain
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:12 2024/9/19
|
||||
func (wh *wrapperHandle) GetDomain(ctx *gin.Context) string {
|
||||
if nil == ctx {
|
||||
return ""
|
||||
}
|
||||
return ctx.Request.Host
|
||||
}
|
||||
|
||||
// GetRequestBody 获取请求body
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Reference in New Issue
Block a user