修复语音无法使用

This commit is contained in:
xaoyaoo 2024-01-14 19:32:47 +08:00
parent 7bb85b402e
commit 97d46a13bd
2 changed files with 2 additions and 1 deletions

View File

@ -185,6 +185,7 @@ def get_audio(savePath):
if not wave_data:
return ReJson(1001)
# 判断savePath路径的文件夹是否存在
savePath = os.path.join(g.tmp_path, savePath)
if not os.path.exists(os.path.dirname(savePath)):
os.makedirs(os.path.dirname(savePath))
with open(savePath, "wb") as f:

View File

@ -239,7 +239,7 @@ class MainShowChatRecords():
g.media_path = args.media_path
g.wxid_path = args.wxid_path
g.my_wxid = args.my_wxid
g.tmp_path = "tmp" # 临时文件夹,用于存放图片等
g.tmp_path = os.path.join(os.getcwd(), "wxdump_tmp") # 临时文件夹,用于存放图片等
g.user_list = []
app.register_blueprint(api)