设置FileStorage_path为非必须选项
This commit is contained in:
parent
fa137677a5
commit
2cd03e5078
@ -176,12 +176,15 @@ def load_chat_records(selected_talker, start_index, page_size, user_list, MSG_AL
|
||||
match = re.search(r"MsgAttach(.*?)'", BytesExtra)
|
||||
if match:
|
||||
img_path = match.group(0).replace("'", "")
|
||||
print(FileStorage_path)
|
||||
print(img_path)
|
||||
img_path = os.path.join(FileStorage_path, img_path)
|
||||
fomt, md5, out_bytes = read_img_dat(img_path)
|
||||
out_bytes = base64.b64encode(out_bytes).decode("utf-8")
|
||||
content["src"] = f"data:{fomt};base64,{out_bytes}"
|
||||
# print(FileStorage_path)
|
||||
# print(img_path)
|
||||
if FileStorage_path:
|
||||
img_path = os.path.join(FileStorage_path, img_path)
|
||||
fomt, md5, out_bytes = read_img_dat(img_path)
|
||||
out_bytes = base64.b64encode(out_bytes).decode("utf-8")
|
||||
content["src"] = f"data:{fomt};base64,{out_bytes}"
|
||||
else:
|
||||
content["src"] = ""
|
||||
else:
|
||||
content["src"] = ""
|
||||
content["msg"] = "图片"
|
||||
|
Loading…
Reference in New Issue
Block a user