You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
752 B
35 lines
752 B
package user
|
|
|
|
import (
|
|
"yunyan/modules"
|
|
|
|
"yunyan/lego/utils/mapstructure"
|
|
)
|
|
|
|
type (
|
|
IOptions interface {
|
|
modules.IOptions
|
|
}
|
|
Options struct {
|
|
modules.Options
|
|
TokenKey string
|
|
CBCKey string
|
|
AvatarUrl string //头像地址
|
|
UserGroup int //用户分组
|
|
OpenTestAccount bool //是否开启测试账号
|
|
TestAccounts []string //是否测试账号
|
|
TestAccountPassword string //是否测试账号密码
|
|
}
|
|
)
|
|
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
if err = mapstructure.Decode(settings, this); err != nil {
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|