Tasks/utils/utils.go

16 lines
262 B
Go
Raw Permalink Normal View History

2016-02-06 18:02:46 +08:00
package utils
import "strings"
func GetRedirectUrl(referer string) string {
var redirectUrl string
url := strings.Split(referer, "/")
if len(url) > 4 {
redirectUrl = "/" + strings.Join(url[3:], "/")
} else {
redirectUrl = "/"
}
return redirectUrl
}