mirror of
https://github.com/Sitoi/dailycheckin.git
synced 2024-11-17 13:48:03 +08:00
Compare commits
2 Commits
95fef73ce1
...
691bd89494
Author | SHA1 | Date | |
---|---|---|---|
|
691bd89494 | ||
|
2455ab8765 |
@ -125,8 +125,11 @@ def message2qywxapp(
|
||||
qywx_corpid, qywx_agentid, qywx_corpsecret, qywx_touser, qywx_media_id, qywx_origin, content
|
||||
):
|
||||
print("企业微信应用消息推送开始")
|
||||
bastUrl = "https://qyapi.weixin.qq.com"
|
||||
if qywx_origin:
|
||||
bastUrl = qywx_origin;
|
||||
res = requests.get(
|
||||
f"https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
|
||||
f"{bastUrl}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
|
||||
)
|
||||
token = res.json().get("access_token", False)
|
||||
if qywx_media_id:
|
||||
@ -159,16 +162,10 @@ def message2qywxapp(
|
||||
"btntxt": "开源项目",
|
||||
},
|
||||
}
|
||||
if qywx_origin:
|
||||
requests.post(
|
||||
url=f"{qywx_origin}/cgi-bin/message/send?access_token={token}",
|
||||
data=json.dumps(data),
|
||||
)
|
||||
else:
|
||||
requests.post(
|
||||
url=f"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={token}",
|
||||
data=json.dumps(data),
|
||||
)
|
||||
requests.post(
|
||||
url=f"{bastUrl}/cgi-bin/message/send?access_token={token}",
|
||||
data=json.dumps(data),
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
|
@ -70,4 +70,5 @@ import { Cards, Card } from 'nextra/components'
|
||||
| _**QYWX_CORPSECRET**_ | corpsecret |
|
||||
| _**QYWX_TOUSER**_ | touser |
|
||||
| _**QYWX_MEDIA_ID**_ | media_id |
|
||||
| _**QYWX_ORIGIN**_ | 企业微信反向代理地址 https://qyapi.weixin.qq.com/cgi-bin/gettoken将其中的https://qyapi.weixin.qq.com替换为**QYWX_ORIGIN** |
|
||||
| _**MERGE_PUSH**_ | **true**: 将推送消息合并;**false**: 分开推送 |
|
||||
|
Loading…
Reference in New Issue
Block a user