mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-12 07:10:44 +08:00
🔧 优化 JSON 写入格式
- 调整 JSON 写入时的缩进为 2 个空格,以保持一致性 - 添加 `sort_keys=False` 参数以避免键排序,保持原有顺序
This commit is contained in:
parent
09109fe9bf
commit
b3e0eead61
@ -82,7 +82,7 @@ def read_json():
|
||||
# 将数据写入 JSON 文件
|
||||
def write_json(data):
|
||||
with open(CONFIG_PATH, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, indent=4, ensure_ascii=False, sort_keys=False)
|
||||
json.dump(data, f, ensure_ascii=False, sort_keys=False, indent=2)
|
||||
|
||||
|
||||
def is_login():
|
||||
|
||||
@ -964,7 +964,7 @@ def main():
|
||||
if cookie_form_file:
|
||||
# 更新配置
|
||||
with open(config_path, "w", encoding="utf-8") as file:
|
||||
json.dump(CONFIG_DATA, file, ensure_ascii=False, indent=2)
|
||||
json.dump(CONFIG_DATA, file, ensure_ascii=False, sort_keys=False, indent=2)
|
||||
|
||||
print(f"===============程序结束===============")
|
||||
duration = datetime.now() - start_time
|
||||
|
||||
Loading…
Reference in New Issue
Block a user