Skip to content

Commit

Permalink
在没有写入权限时记录warn日志
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-yafeng authored Dec 31, 2024
1 parent 041f725 commit 42cee0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/webui/src/helper/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export class WebUiConfigWrapper {
if (await fs.access(configPath, constants.W_OK).then(() => true).catch(() => false)) {
await fs.writeFile(configPath, JSON.stringify(parsedConfig, null, 4));
}
else {
console.warn(`文件: ${configPath} 没有写入权限, 配置的更改部分可能会在重启后还原.`);
}
// 不希望回写的配置放后面

// 查询主机地址是否可用
Expand Down

0 comments on commit 42cee0d

Please sign in to comment.