mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-03-22 11:18:59 +00:00
commit
30e830936c
@ -58,8 +58,17 @@ def printf(text):
|
|||||||
def get_remarkinfo():
|
def get_remarkinfo():
|
||||||
url='http://127.0.0.1:5600/api/envs'
|
url='http://127.0.0.1:5600/api/envs'
|
||||||
try:
|
try:
|
||||||
with open('/ql/config/auth.json', 'r') as f:
|
path = '/ql/config/auth.json' # 设置青龙 auth文件地址
|
||||||
token=json.loads(f.read())['token']
|
if not os.path.isfile(path):
|
||||||
|
path = '/ql/data/config/auth.json' # 尝试设置青龙 auth 新版文件地址
|
||||||
|
if os.path.isfile(path): # 进行文件真值判断
|
||||||
|
with open(path, "r") as file: # 上下文管理
|
||||||
|
auth = file.read() # 读取文件
|
||||||
|
file.close() # 关闭文件
|
||||||
|
auth = json.loads(auth) # 使用 json模块读取
|
||||||
|
# with open('/ql/config/auth.json', 'r') as f:
|
||||||
|
# token=json.loads(f.read())['token']
|
||||||
|
token = auth["token"] # 提取 authkey
|
||||||
headers={
|
headers={
|
||||||
'Accept':'application/json',
|
'Accept':'application/json',
|
||||||
'authorization':'Bearer '+token,
|
'authorization':'Bearer '+token,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user