format .
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from uvicorn.server import logger
|
||||
|
||||
from config import Settings
|
||||
from utils.wxcom.WXBizMsgCrypt3 import WXBizMsgCrypt
|
||||
from utils.wxcom.WXBizMsgCrypt3 import WXBizMsgCrypt
|
||||
|
||||
|
||||
def get_wxcpt():
|
||||
@@ -15,20 +16,20 @@ def get_wxcpt():
|
||||
required_configs = [
|
||||
Settings().WECOM_APP_TOKEN,
|
||||
Settings().WECOM_APP_ENCODING_AES_KEY,
|
||||
Settings().WECOM_CORPID
|
||||
Settings().WECOM_CORPID,
|
||||
]
|
||||
|
||||
|
||||
if not all(required_configs):
|
||||
raise ValueError("企业微信配置不完整")
|
||||
|
||||
|
||||
return WXBizMsgCrypt(
|
||||
Settings().WECOM_APP_TOKEN, # 设置的Token
|
||||
Settings().WECOM_APP_ENCODING_AES_KEY, # 设置密钥
|
||||
Settings().WECOM_CORPID # 企业ID
|
||||
Settings().WECOM_CORPID, # 企业ID
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"初始化WXBizMsgCrypt失败: {str(e)}")
|
||||
raise
|
||||
|
||||
|
||||
wxcpt = get_wxcpt()
|
||||
|
||||
Reference in New Issue
Block a user