在没有写入权限时记录warn日志

This commit is contained in:
WuYafeng authored and GitHub committed 2024-12-31 22:38:01 +08:00
1 parent 07ac3c2362
commit 3aec1f697b
1 file changed
+3
+3
View File
@@ -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} 没有写入权限, 配置的更改部分可能会在重启后还原.`);
}
// 不希望回写的配置放后面
// 查询主机地址是否可用