Skip to content

Commit

Permalink
fix: WebUI不可用
Browse files Browse the repository at this point in the history
  • Loading branch information
ikun0014 authored and helloplhm-qwq committed Feb 22, 2024
1 parent 715206e commit 27e2f66
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ def openFailedDialog():
# print(args)

try:
with open("config.json", "r+", encoding="utf-8") as f:
with open("./data/config.json", "r+", encoding="utf-8") as f:
config = json.loads(f.read())
config = update_nested_json(config, args)

i = 1
while 1:
try:
os.rename("config.json", f"config{i}.bak")
os.rename("./data/config.json", f"config{i}.bak")
break
except:
i += 1

with open("config.json", "w+", encoding="utf-8") as f:
with open("./data/config.json", "w+", encoding="utf-8") as f:
f.write(
json.dumps(
config, indent=4, ensure_ascii=False, escape_forward_slashes=False
Expand Down Expand Up @@ -1648,7 +1648,7 @@ def route_change(route):

if __name__ == "__main__":
try:
with open("config.json", "r+", encoding="utf-8") as f:
with open("./data/config.json", "r+", encoding="utf-8") as f:
config = json.loads(f.read())
except:
print("无法找到config.json,请先运行main.py生成config.json")
Expand Down

0 comments on commit 27e2f66

Please sign in to comment.