Skip to content

Commit

Permalink
fix:后台保存设置字符串问题,新增背景透明度设置项
Browse files Browse the repository at this point in the history
  • Loading branch information
vastsa committed Jun 18, 2024
1 parent b3004a3 commit 8afae1f
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 17 deletions.
9 changes: 9 additions & 0 deletions apps/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ async def get_config():
@admin_api.patch('/config/update', dependencies=[Depends(admin_required)])
async def update_config(data: dict):
admin_token = data.get('admin_token')
for key, value in data.items():
if key not in settings.default_config:
continue
if key in ['errorCount', 'errorMinute', 'max_save_seconds', 'onedrive_proxy', 'openUpload', 'port', 's3_proxy', 'uploadCount', 'uploadMinute', 'uploadSize']:
data[key] = int(value)
elif key in ['opacity']:
data[key] = float(value)
else:
data[key] = value
if admin_token is None or admin_token == '':
return APIResponse(code=400, detail='管理员密码不能为空')
await KeyValue.filter(key='settings').update(value=data)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions fcb-fronted/dist/assets/SettingView-0faa0832.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion fcb-fronted/dist/assets/SettingView-d6a183ca.js

This file was deleted.

Loading

0 comments on commit 8afae1f

Please sign in to comment.