From 6d940622471835bf8dd9069d18b332db88f9dfbb Mon Sep 17 00:00:00 2001 From: v_wmcowen Date: Thu, 19 Dec 2024 11:42:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=A7=A6=E5=8F=91=E5=99=A8=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=9C=BA=E5=99=A8=E4=BA=BA=E9=80=9A?= =?UTF-8?q?=E7=9F=A5webhook=E9=80=9A=E7=9F=A5=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/default.py | 3 +++ itsm/component/utils/robot.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/default.py b/config/default.py index 12a82dbf1..239667c41 100644 --- a/config/default.py +++ b/config/default.py @@ -25,6 +25,7 @@ import base64 import datetime import importlib +import os from urllib.parse import urljoin, urlparse from blueapps.conf.default_settings import * # noqa @@ -971,3 +972,5 @@ def redirect_func(request): PIPELINE_ENGINE_ADMIN_API_PERMISSION = ( "itsm.helper.permissions.check_permission_success" ) + +QW_WEB_HOOK_URL = os.getenv("BKAPP_QW_WEB_HOOK_URL", "") diff --git a/itsm/component/utils/robot.py b/itsm/component/utils/robot.py index c1bb4efb2..b81d9a283 100644 --- a/itsm/component/utils/robot.py +++ b/itsm/component/utils/robot.py @@ -30,9 +30,10 @@ from common.log import logger from common.sub_string import sub_string +from django.conf import settings -WEB_HOOK_URL = "http://in.qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}" +QW_WEB_HOOK_URL = settings.QW_WEB_HOOK_URL class Announcement(Thread): @@ -63,7 +64,7 @@ def run(self): if self.chat_ids is not None: data["chatid"] = self.chat_ids resp = session.post( - url=WEB_HOOK_URL.format(self.web_hook_id), + url=QW_WEB_HOOK_URL.format(self.web_hook_id), data=json.dumps(data), verify=False, ) From f61a48ef6ff6945f28c91b8b6a7020c5a98044d8 Mon Sep 17 00:00:00 2001 From: v_wmcowen Date: Thu, 19 Dec 2024 14:25:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=A7=A6=E5=8F=91=E5=99=A8=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=9C=BA=E5=99=A8=E4=BA=BA=E9=80=9A?= =?UTF-8?q?=E7=9F=A5webhook=E9=80=9A=E7=9F=A5=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20doc:=20=E6=9B=B4=E6=96=B0=202.7.3=20?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/default.py | 11 ++++++++++- docs/RELEASE.md | 1 + docs/RELEASE_EN.md | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/default.py b/config/default.py index 239667c41..082dbbc00 100644 --- a/config/default.py +++ b/config/default.py @@ -973,4 +973,13 @@ def redirect_func(request): "itsm.helper.permissions.check_permission_success" ) -QW_WEB_HOOK_URL = os.getenv("BKAPP_QW_WEB_HOOK_URL", "") +if RUN_VER == "ieod": + QW_WEB_HOOK_URL = os.getenv( + "BKAPP_QW_WEB_HOOK_URL", + "http://in.qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}", + ) +else: + QW_WEB_HOOK_URL = os.getenv( + "BKAPP_QW_WEB_HOOK_URL", + "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}", + ) diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 14d964646..ca414ec1d 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -3,6 +3,7 @@ 【新增】meta上下文管理功能,应用于快速审批、MOA和通知过滤 【修复】API请求节点POST参数编辑渲染问题 【修复】"提交"按钮未国际化,英语界面下"返回单据列表"按钮文字超出 +【修复】触发器企业微信机器人通知webhook通知发送失败 ## [Version: 2.7.2] - 2024-11-18 diff --git a/docs/RELEASE_EN.md b/docs/RELEASE_EN.md index 8badc0317..7297cd8aa 100644 --- a/docs/RELEASE_EN.md +++ b/docs/RELEASE_EN.md @@ -3,6 +3,7 @@ 【Feature】Add meta context management, applied to fast approval, MOA, and notification receivers filter. 【Fix】API request node POST parameter editing rendering issue. 【Fix】"Submit" button was not internationalized, "Return to Ticket List" button text overflow. +【Fix】Resolve the issue of WeChat Work Bot Trigger webhook notification failure. ## [Version: 2.7.2] - 2024-11-18