当前位置:网站首页>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
边栏推荐
- Briefly describe the hierarchical strategy of memory
- User manual of Chinese version of solidity ide Remix
- 渗透测试面试合集---HVV---
- 高精度焊接机械臂定位
- [Effective Go 中文翻译] 第一篇
- PHP generates short links: convert numbers to letters and letters to numbers
- Summary of facial classics
- 巨头押注的全屋智能,正在驱动海信、华为、小米们「自我革命」
- Go语学习笔记 - 结构体 | 从零开始Go语言
- Positioning of high precision welding manipulator
猜你喜欢
Canvas learning Chapter 1
Smart business card applet business card details page function implementation key code
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface
几种智能机器人室内定位方法对比
雲計算技能大賽 -- openstack私有雲環境 第一部分
云计算技能大赛 -- openstack私有云环境 第一部分
【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立
Go语学习笔记 - Slice、Map | 从零开始Go语言
vivo,硬件安全的爱与雷霆
数据库之Mysql——概述安装篇
随机推荐
Principle of sentinel integrating Nacos to update data dynamically
访问数据库的时候出现错误 Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.详解
一个没啥L用,但可以装X的IDEA插件
Go语学习笔记 - 结构体 | 从零开始Go语言
Compiler des questions de principe - avec des réponses
Manipulator motion planning in 3C assembly
在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
[untitled]
KVM安装部署
Research on system and software security (I)
输入 “ net start mysql ”,出现 “ 发生系统错误 5。 拒绝访问 ” 。问题详解
Positioning and decoration style
1216_ MISRA_ C standard learning notes_ Rule requirements for control flow
LeetCoed18. Sum of four numbers
Summary of facial classics
BUUCTF [极客大挑战 2019]EasySQL1
MySQL——第一章节(MySQL中的数据类型)
GUI,CLI与Unix哲学
Upload labs range practice
Mobile terminal layout (3D conversion, animation)