优化用户级配置能力

This commit is contained in:
Allen
2024-04-23 09:51:18 +08:00
parent ae60040120
commit d6c6c999fc
3 changed files with 37 additions and 43 deletions

View File

@ -190,7 +190,7 @@ def get_config(key: str,
"""
查询用户配置
"""
value = UserConfigOper().get(current_user.id, key)
value = UserConfigOper().get(username=current_user.name, key=key)
return schemas.Response(success=True, data={
"value": value
})
@ -201,5 +201,5 @@ def set_config(key: str, value: Union[list, dict, bool, int, str] = None,
"""
更新用户配置
"""
UserConfigOper().set(current_user.id, key, value)
UserConfigOper().set(username=current_user.name, key=key, value=value)
return schemas.Response(success=True)