当我按下"保存"按钮来存储我的API密钥时,JSON文件通过将其从文件中删除而不是干扰它来替换我现有的Steam64ID.任何帮助都会得到重视.
//Save API Key to JSON
saveapi.addEventListener('click', () => {
const apiKey = apibox.value;
const data = { apikey: apiKey };
const jsonStr = JSON.stringify(data, null, 2);
window.electronAPI.writeFile(jsonStr);
});
//Save Steam64 ID to JSON
savesteam64.addEventListener('click', () => {
const steam64id = steam64box.value;
const data = { steam64id: steam64id };
const jsonStr = JSON.stringify(data, null, 2);
window.electronAPI.writeFile(jsonStr);
});
{
"apikey": ""
"steam64id": "" //This gets removed when I try save the api key
}