更新 profile
This commit is contained in:
parent
fb2bcd87eb
commit
963940c367
|
@ -9,6 +9,7 @@ import (
|
|||
"fusenapi/utils/fssql"
|
||||
"fusenapi/utils/handlers"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
@ -113,25 +114,17 @@ func (m *FsUserInfoModel) GetProfile(ctx context.Context, pkey string, userId in
|
|||
return m.getDefaultProfile(ctx, tname)
|
||||
}
|
||||
|
||||
if logoSelected, ok := info["logo_selected"]; ok {
|
||||
if version, ok := logoSelected.(map[string]any)["version"]; ok {
|
||||
if ver, ok := version.(string); ok {
|
||||
if ver != versionML {
|
||||
if logoSelected := gjson.Get(v, "logo_selected"); logoSelected.Exists() {
|
||||
if ver := logoSelected.Get("version"); ver.Exists() && ver.String() == versionML {
|
||||
return info, nil
|
||||
}
|
||||
}
|
||||
|
||||
defaultUserInfo, err := m.getDefaultProfile(ctx, tname)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
info["logo_selected"] = defaultUserInfo["logo_selected"]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
defaultUserInfo, err := m.getDefaultProfile(ctx, tname)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
info["logo_selected"] = defaultUserInfo["logo_selected"]
|
||||
}
|
||||
|
||||
return info, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user