Test: remote callback auth

This commit is contained in:
HFO4
2019-12-30 19:56:01 +08:00
parent 4a5782b4e5
commit eceee2fc76
3 changed files with 153 additions and 4 deletions

View File

@@ -177,7 +177,9 @@ func (user *User) AfterCreate(tx *gorm.DB) (err error) {
// AfterFind 找到用户后的钩子
func (user *User) AfterFind() (err error) {
// 解析用户设置到OptionsSerialized
err = json.Unmarshal([]byte(user.Options), &user.OptionsSerialized)
if user.Options != "" {
err = json.Unmarshal([]byte(user.Options), &user.OptionsSerialized)
}
// 预加载存储策略
user.Policy, _ = GetPolicyByID(user.GetPolicyID())