fix: 修复配置页面默认配置被置空的问题

This commit is contained in:
涵曦 2024-07-06 00:32:10 +00:00
parent cb0bae5ae7
commit e10f5b89b6
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ var vConsole = new window.VConsole();
<input id="music_path" type="text" value="music"></input> <input id="music_path" type="text" value="music"></input>
<label for="download_path">音乐下载目录(必须是music的子目录):</label> <label for="download_path">音乐下载目录(必须是music的子目录):</label>
<input id="download_path" type="text"></input> <input id="download_path" type="text" value='music/download'></input>
<label for="conf_path">配置文件目录:</label> <label for="conf_path">配置文件目录:</label>
<input id="conf_path" type="text"></input> <input id="conf_path" type="text"></input>

View File

@ -78,7 +78,7 @@ $(function(){
for (const key in data) { for (const key in data) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
const $element = $("#" + key); const $element = $("#" + key);
if ($element.length) { if ($element.length && data[key] !== '') {
if (data[key] === true) { if (data[key] === true) {
$element.val('true'); $element.val('true');
} else if (data[key] === false) { } else if (data[key] === false) {