forked from OrgGo/Tasks
16 lines
262 B
Go
16 lines
262 B
Go
|
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
|
||
|
}
|