Merge branch 'Womsxd:master' into master
This commit is contained in:
commit
e458411c5b
13
config.py
13
config.py
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user