package user_m import ( "git.hilo.cn/hilo-common/resource/config" "strconv" "strings" ) var superUsers []uint64 func IsSuperUser(userId uint64) bool { for _, i := range superUsers { if i == userId { return true } } return false } func init() { // 初始化超级用户 strUsers := strings.Split(config.GetConfigApp().SUPERUSER, ",") for _, i := range strUsers { if u, err := strconv.ParseUint(i, 10, 64); err == nil { superUsers = append(superUsers, u) } } }