mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-20 12:46:17 +08:00
16 lines
255 B
Go
16 lines
255 B
Go
![]() |
package utils
|
||
|
|
||
|
import (
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
"net/url"
|
||
|
)
|
||
|
|
||
|
func GetCode(rawUrl string) string {
|
||
|
u,err:=url.Parse(rawUrl)
|
||
|
if err!=nil {
|
||
|
log.Errorf("解析url出错:%s",err.Error())
|
||
|
return ""
|
||
|
}
|
||
|
code:=u.Query().Get("code")
|
||
|
return code
|
||
|
}
|