当前位置:网站首页>idea:使用easyYapi插件导出yapi接口
idea:使用easyYapi插件导出yapi接口
2022-04-23 06:59:00 【百事可乐啊】
idea:使用easyYapi插件导出yapi接口
一、安装插件easyYapi
安装easyYapi插件: 插件拦搜索easyYapi安装并重启idea
二、配置easyYapi
- window系统路径:File-Settings —>other Settings —>EasyApi
Token方式
server:yapi的地址
tokens:当前要生成的controller文件所在的项目的名称=yapi上要导入项目的token
导出接口:
先选择要导入的controller文件,然后右键选择Export Api
点击绿色钩子后,会弹出一个输入框,让你输入Yapi对应项目下的Token
Export Yapi 出现输入token框,将上面步骤的token直接复制,点击ok,如下图所示:
控制台提示导入成功:
项目id方式
Yapi版本太低导致一直no found token 的解决办法:
在EasyApi配置中选中 loginMode,并将项目token改成项目id,如下图所示:
项目id是yapi中项目的id,如下图所示:
之后在EasyApi下的Built-in config中加入鉴权逻辑,如下图所示:
url中ip和端口改成自己yapi的地址
body中的 email 和 password 是你登陆yapi的时候输入的email 和 password
yapi.export.before=groovy:```
httpClient.request().url("http://127.0.0.1:3000/api/user/login")
.method("POST")
.contentType("application/json")
.body(["email":"[email protected]","password":"*******"])
.call();
```
之后再次执行上述导出接口步骤,输入项目id,即可成功。
版权声明
本文为[百事可乐啊]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43296313/article/details/124343196
边栏推荐
猜你喜欢
随机推荐
PHP high precision computing
Samsung, March to the west again
Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack
Alibaba sentinel learning QA
云计算技能大赛 -- openstack私有云环境 第一部分
C outputs a two-dimensional array with the following characteristics.
Asynchronous learning
NFT ecological development of Ignis public chain: unicorn Donation and development of Art
Find the largest of 3 strings (no more than 20 characters per string).
Mobile web (Font Icon, plane conversion, color gradient)
LeetCode15. Sum of three
浏览器中的 Kubernetes 和 IDE | 交互式学习平台Killercoda
浅谈ES6尾调优化
User manual of Chinese version of solidity ide Remix
GUI,CLI与Unix哲学
Canvas learning Chapter 1
Intranet penetration series: ICMP of Intranet tunnel_ Tran
Jetson Xavier NX (3) bazel mediapipe installation
为什么会存在1px问题?怎么解决?
[untitled]