first commit
This commit is contained in:
29
pkg/utils/p_tools.go
Normal file
29
pkg/utils/p_tools.go
Normal file
@ -0,0 +1,29 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// 获取ticket
|
||||
func GetJxApiTicket() (result string) {
|
||||
|
||||
ticket := viper.GetString("tuilan_ticket")
|
||||
result = ticket
|
||||
return
|
||||
}
|
||||
|
||||
// 是否在白名单
|
||||
func IsWhiteIp(ip string) (result bool) {
|
||||
|
||||
result = false
|
||||
|
||||
whiteList := []string{
|
||||
"120.53.99.84",
|
||||
"175.11.144.242",
|
||||
}
|
||||
|
||||
result = IsInStringList(ip, whiteList)
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user