Update app.py
Browse files
app.py
CHANGED
@@ -44,9 +44,9 @@ def fx_datatable(s:str):
|
|
44 |
a=exec(s)
|
45 |
return {k: v for k, v in locals().items() if isinstance(v,pd.DataFrame)}
|
46 |
|
47 |
-
def fx_dd(s:str):
|
48 |
headers= {"Content-Type": "application/json"}
|
49 |
-
url="https://oapi.dingtalk.com/robot/send?access_token
|
50 |
data={'msgtype':'text','text':{'title': '吹牛逼',"content": s}, 'at': {'atMobiles': [], 'isAtAll': True}}
|
51 |
response=requests.post(url,json=data,headers=headers)
|
52 |
return response.text
|
@@ -90,7 +90,7 @@ with demo:
|
|
90 |
|
91 |
with gr.TabItem("钉钉群消息推送"):
|
92 |
gr.Markdown("# 推送测试")
|
93 |
-
dd_input=gr.Textbox(label="请填写需要推送的信息",lines=
|
94 |
dd_output=gr.Textbox(label="推送提示")
|
95 |
dd_button=gr.Button("提交")
|
96 |
dd_button.click(fx_dd, inputs=dd_input, outputs=dd_output,api_name='dingding')
|
|
|
44 |
a=exec(s)
|
45 |
return {k: v for k, v in locals().items() if isinstance(v,pd.DataFrame)}
|
46 |
|
47 |
+
def fx_dd(tk:str,s:str):
|
48 |
headers= {"Content-Type": "application/json"}
|
49 |
+
url="https://oapi.dingtalk.com/robot/send?access_token="+tk
|
50 |
data={'msgtype':'text','text':{'title': '吹牛逼',"content": s}, 'at': {'atMobiles': [], 'isAtAll': True}}
|
51 |
response=requests.post(url,json=data,headers=headers)
|
52 |
return response.text
|
|
|
90 |
|
91 |
with gr.TabItem("钉钉群消息推送"):
|
92 |
gr.Markdown("# 推送测试")
|
93 |
+
dd_input=[gr.Textbox(label="请填写机器人token"),gr.Textbox(label="请填写需要推送的信息",lines=10)]
|
94 |
dd_output=gr.Textbox(label="推送提示")
|
95 |
dd_button=gr.Button("提交")
|
96 |
dd_button.click(fx_dd, inputs=dd_input, outputs=dd_output,api_name='dingding')
|