增加示例,调用返回值为字典类型的方法

This commit is contained in:
zy7y 2021-05-04 23:49:40 +08:00
parent b980ab295f
commit e0a245de6d
3 changed files with 9 additions and 1 deletions

View File

@ -117,7 +117,8 @@ https://www.bilibili.com/video/BV1EE411B7SU?p=10
2021/05/04 用例增加Header栏可使用自定义方法以及提取参数如下所以取消了 `token操作栏`
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504121842.png)
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504122609.png)
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504234703.png)
![](https://gitee.com/zy7y/blog_images/raw/master/img/20210504234820.png)
## 博客园首发
https://www.cnblogs.com/zy7y/p/13426816.html

Binary file not shown.

View File

@ -12,6 +12,7 @@
关于exec执行python代码可查阅资料https://python3-cookbook.readthedocs.io/zh_CN/latest/c09/p23_executing_code_with_local_side_effects.html
"""
import json
import time
@ -36,6 +37,12 @@ def sum_data(a, b):
return a + b
def set_token(token: str):
"""设置token直接返回字典"""
return {"Authorization": token}
if __name__ == '__main__':
# 实例, 调用无参数方法 get_current_highest
result = exec_func("get_current_highest()")