From efb3bd93d02573148ace60af96d4580a64d951a9 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Fri, 27 Sep 2024 04:27:16 +0800 Subject: [PATCH] fix(wechat): reorder proxy setup --- app/modules/wechat/wechat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/modules/wechat/wechat.py b/app/modules/wechat/wechat.py index c8d6959ab..4c675f9de 100644 --- a/app/modules/wechat/wechat.py +++ b/app/modules/wechat/wechat.py @@ -50,15 +50,15 @@ def __init__(self, WECHAT_CORPID: str = None, WECHAT_APP_SECRET: str = None, WEC self._appid = WECHAT_APP_ID self._proxy = WECHAT_PROXY or "https://qyapi.weixin.qq.com" - if self._corpid and self._appsecret and self._appid: - self.__get_access_token() - if self._proxy: self._proxy = self._proxy.rstrip("/") self._send_msg_url = f"{self._proxy}/{self._send_msg_url}" self._token_url = f"{self._proxy}/{self._token_url}" self._create_menu_url = f"{self._proxy}/{self._create_menu_url}" + if self._corpid and self._appsecret and self._appid: + self.__get_access_token() + def get_state(self): """ θŽ·ε–ηŠΆζ€