From e84ea0339ed39ab64eefef586b703973e6e34d34 Mon Sep 17 00:00:00 2001 From: freeziyou <80776877@qq.com> Date: Tue, 27 Feb 2024 13:16:39 +0800 Subject: [PATCH] change params order --- server/routes/user.py | 2 +- server/tasks/lark/chat.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/routes/user.py b/server/routes/user.py index 471888cd..ece91c1f 100644 --- a/server/routes/user.py +++ b/server/routes/user.py @@ -62,7 +62,7 @@ def set_account(): return jsonify({"code": 0, "msg": "success"}) -@bp.route("////image/", methods=["GET"]) +@bp.route("////image/", methods=["GET"]) def get_image(team_id, message_id, repo_id, img_key): """ 1. 用 img_key 请求飞书接口下载 image diff --git a/server/tasks/lark/chat.py b/server/tasks/lark/chat.py index cfc179c7..bf499890 100644 --- a/server/tasks/lark/chat.py +++ b/server/tasks/lark/chat.py @@ -349,7 +349,7 @@ def process_desc(app_id, message_id, repo_id, desc, data, team, *args, **kwargs) def replace_images_keys_with_url(text, team_id, message_id, repo_id): """ replace image_key with image URL. - ![](image_key) -> ![](gitmaya.com/api////image/) + ![](image_key) -> ![](gitmaya.com/api////image/) Args: text (str): original text @@ -359,7 +359,7 @@ def replace_images_keys_with_url(text, team_id, message_id, repo_id): host = os.environ.get("DOMAIN") replaced_text = re.sub( r"!\[.*?\]\((.*?)\)", - lambda match: f"![]({host}/api/{team_id}/{message_id}/{repo_id}/image/{match.group(1)})", + lambda match: f"![]({host}/api/{team_id}/{repo_id}/{message_id}/image/{match.group(1)})", text, )