fix 配置接口请求失效

This commit is contained in:
2023-08-01 14:18:44 +08:00
parent a0d7b9b17f
commit e4151b94ed
3 changed files with 26 additions and 12 deletions

View File

@@ -16,11 +16,12 @@ function getConfig() {
/**
* 保存配置文件
* @param string {JSON}
* @param string
* @return {boolean}
*/
function setConfig(string) {
fs.writeFileSync("config.json", JSON.stringify(string, null, 2));
console.info(string)
fs.writeFileSync("config.json", JSON.parse(string));
return getConfig() === string;
}