30 lines
382 B
Go
30 lines
382 B
Go
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
|
|
|
|
}
|