mirror of
https://github.com/JasonYANG170/AutoCheckBJMF.git
synced 2024-11-23 12:16:25 +00:00
V5.1:fix pushplus bug
This commit is contained in:
parent
ad15bf62e5
commit
214eafc55b
12
data.json
12
data.json
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"class": "123",
|
"class": "75717",
|
||||||
"lat": "123",
|
"lat": "23.21",
|
||||||
"lng": "123",
|
"lng": "112.49",
|
||||||
"acc": "123",
|
"acc": "5.7",
|
||||||
"time": 123,
|
"time": 60,
|
||||||
"cookie": "123",
|
"cookie": "wxid=ollOC0St_f4yM2Fl5a-ERD_WdH3Q$1713787685$57ae26b15c100b18666d5256b6a751c7; s=q2gGIHSmw5ke0Bdk41BvvJfdj4GM7jxFF4PRiWKg; remember_student_59ba36addc2b2f9401580f014c7f58ea4e30989d=2100368%7CC7i0ngsrbffKy1b7EPRRPAbvg2vdPjaa93f6WbnwFp6lHJP4vZ4zPKfMFJgL%7C; Hm_lvt_362de400d3fe4117e8e3513a52c0da9d=1713207421,1713295547,1713728251,1713787687; Hm_lpvt_362de400d3fe4117e8e3513a52c0da9d=1713787691",
|
||||||
"scheduletime": "",
|
"scheduletime": "",
|
||||||
"pushplus": "123"
|
"pushplus": "123"
|
||||||
}
|
}
|
19
main.py
19
main.py
|
@ -81,21 +81,22 @@ with open('data.json', 'r') as file:
|
||||||
print("----------配置通知(可选)----------")
|
print("----------配置通知(可选)----------")
|
||||||
if (json_data['pushplus'] == "123"):
|
if (json_data['pushplus'] == "123"):
|
||||||
token = input("请输入pushplus推送密钥,不需要请留空:")
|
token = input("请输入pushplus推送密钥,不需要请留空:")
|
||||||
|
if(token!=""):
|
||||||
# 1. 读取JSON文件
|
# 1. 读取JSON文件
|
||||||
# JSON文件路径
|
# JSON文件路径
|
||||||
file_name = "data.json"
|
file_name = "data.json"
|
||||||
file_path = os.path.join(current_directory, file_name)
|
file_path = os.path.join(current_directory, file_name)
|
||||||
with open(file_path, "r") as file:
|
with open(file_path, "r") as file:
|
||||||
data = json.load(file)
|
data = json.load(file)
|
||||||
|
|
||||||
# 2. 修改数据
|
# 2. 修改数据
|
||||||
data["pushplus"] = token
|
data["pushplus"] = token
|
||||||
# 3. 写回JSON文件
|
# 3. 写回JSON文件
|
||||||
with open(file_path, "w") as file:
|
with open(file_path, "w") as file:
|
||||||
json.dump(data, file, indent=4)
|
json.dump(data, file, indent=4)
|
||||||
|
|
||||||
|
print("数据已保存到" + current_directory + "下的data.json中。")
|
||||||
|
|
||||||
print("数据已保存到" + current_directory + "下的data.json中。")
|
|
||||||
else:
|
else:
|
||||||
token = json_data['pushplus'] # input("请输入pushplus密钥:")
|
token = json_data['pushplus'] # input("请输入pushplus密钥:")
|
||||||
print("----------信息----------")
|
print("----------信息----------")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user