:tada:初步完成用户
This commit is contained in:
23
utils/website.go
Normal file
23
utils/website.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package utils
|
||||
|
||||
import "net/url"
|
||||
|
||||
type website struct{}
|
||||
|
||||
func WebSite() website {
|
||||
return website{}
|
||||
}
|
||||
|
||||
// GetHost
|
||||
// @description: 获取主机host
|
||||
// @receiver website
|
||||
// @param addr
|
||||
// @return string
|
||||
func (website) GetHost(addr string) string {
|
||||
uu, err := url.Parse(addr)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return uu.Host
|
||||
}
|
||||
Reference in New Issue
Block a user