Files
Nexus/docs/changelog/2026-06-12-settings-push-complete-sound-default.md
T
2026-07-08 22:31:31 +08:00

34 lines
823 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-06-12 修复 push_complete_sound GET 404
## 摘要
`GET /api/settings/push_complete_sound` 在 MySQL 尚无该行时返回 404;现对已有默认值的设置项返回默认 JSON。
## 动机
登录后 `App.vue` 调用 `syncPushSoundFromServer` 触发 404`script_exec_complete_sound` 同理。
## 涉及文件
- `server/api/settings.py``SETTING_DEFAULTS` + `get_setting` 回退
- `tests/test_settings_sound_defaults.py`
## 默认
| key | 默认 |
|-----|------|
| `push_complete_sound` | `beep_double` |
| `script_exec_complete_sound` | `beep_double` |
| `theme` | `dark` |
## 验证
```bash
venv/bin/pytest tests/test_settings_sound_defaults.py -q
# 生产(JWTGET /api/settings/push_complete_sound → 200 {"value":"beep_double",...}
```
## 迁移
无;首次 PUT 仍会 upsert 入库。