fix: 修复移动端终端字号加载异常的问题

#53
This commit is contained in:
Baobhan Sith
2025-05-29 18:28:12 +08:00
parent c44f1606d6
commit ef33726a11
3 changed files with 17 additions and 0 deletions
@@ -94,6 +94,16 @@ export const updateSettings = async (settingsDto: UpdateAppearanceDto): Promise<
settingsDto.terminalFontSize = size;
}
// 验证 terminalFontSizeMobile (如果提供了)
if (settingsDto.terminalFontSizeMobile !== undefined && settingsDto.terminalFontSizeMobile !== null) {
const size = Number(settingsDto.terminalFontSizeMobile);
if (isNaN(size) || size <= 0) {
throw new Error(`无效的移动端终端字体大小: ${settingsDto.terminalFontSizeMobile}。必须是一个正数。`);
}
// 确保类型正确传递给仓库层
settingsDto.terminalFontSizeMobile = size;
}
// 验证 editorFontSize (如果提供了)
if (settingsDto.editorFontSize !== undefined && settingsDto.editorFontSize !== null) {
const size = Number(settingsDto.editorFontSize);