fix:兼容网页端上传的图片原图获取

This commit is contained in:
bigfa 2024-04-24 14:16:35 +08:00
parent e41fc05eac
commit 99d53cd945
1 changed files with 2 additions and 1 deletions

View File

@ -273,7 +273,8 @@ def get_img_urls_by_trace_id(trace_id: str, format_type: str = "png"):
def get_trace_id(img_url: str): def get_trace_id(img_url: str):
return img_url.split("/")[-1] # 浏览器端上传的图片多了 /spectrum/ 这个路径
return f"spectrum/{img_url.split("/")[-1]}" if img_url.find("spectrum") != -1 else img_url.split("/")[-1]
if __name__ == '__main__': if __name__ == '__main__':