Merge branch 'Womsxd:master' into master

This commit is contained in:
hinak0 2022-10-07 16:36:23 +08:00 committed by GitHub
commit e458411c5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -44,11 +44,16 @@ config = {
}
path = os.path.dirname(os.path.realpath(__file__)) + "/config"
if os.getenv("AutoMihoyoBBS_config_path") is not None:
path = os.getenv("AutoMihoyoBBS_config_path")
config_Path_json = f"{path}/config.json"
config_Path = f"{path}/config.yaml"
def copy_config():
return config
def load_config_json():
with open(config_Path_json, "r") as f:
data = json.load(f)
@ -107,7 +112,7 @@ def config_v7_update(data: dict):
def load_config(p_path=None):
global config
if not p_path:
p_path=config_Path
p_path = config_Path
with open(p_path, "r", encoding='utf-8') as f:
data = yaml.load(f, Loader=yaml.FullLoader)
if data['version'] == 7:
@ -119,14 +124,14 @@ def load_config(p_path=None):
return config
def save_config(p_path=None,p_config=None):
def save_config(p_path=None, p_config=None):
global serverless
if serverless:
log.info("云函数执行,无法保存")
return None
if not p_path:
p_path=config_Path
p_config=config
p_path = config_Path
p_config = config
with open(p_path, "w+") as f:
try:
f.seek(0)

View File

@ -1,9 +1,9 @@
# 米游社的Salt
mihoyobbs_Salt = "6J1hde1Wu02eF1DFlLpMjeg2dMloAytL"
mihoyobbs_Salt = "PVeGWIZACpxXZ1ibMVJPi9inCY4Nd4y2"
mihoyobbs_Salt2 = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v"
mihoyobbs_Salt_web = "Qqx8cyv7kuyD8fTw11SmvXSFHp7iZD29"
mihoyobbs_Salt_web = "yUZ3s0Sna1IrSNfk29Vo6vRapdOyqyhB"
# 米游社的版本
mihoyobbs_Version = "2.37.1" # Slat和Version相互对应
mihoyobbs_Version = "2.38.1" # Salt和Version相互对应
# 米游社的客户端类型
mihoyobbs_Client_type = "2" # 1为ios 2为安卓
mihoyobbs_Client_type_web = "5" # 4为pc web 5为mobile web