1 Star 0 Fork 6

白露野僧/study_nest

forked from 刘学帅/study_nest 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.http 4.18 KB
一键复制 编辑 原始数据 按行查看 历史
xueshuailiu 提交于 2023-08-02 22:03 . 登陆
# https://juejin.cn/post/6844904049725145095
### 内置的验证器
POST http://localhost:3000/user
content-type: application/json
{
"name":"Hendry",
"age": 26,
"sex": true,
"hobbies": ["篮球", "dota2"]
}
### 测试自己的验证器
POST http://localhost:3000/user/joi
content-type: application/json
{
"name": "123"
}
### 增加用户
POST http://localhost:3000/user
content-type: application/json
{
"name": "123"
}
### 查询全部用户
GET http://localhost:3000/user/
content-type: application/json
### 修改用户
PATCH http://localhost:3000/user/1
content-type: application/json
{
"name": "i love china"
}
### 查询指定的用户
GET http://localhost:3000/user/1
content-type: application/json
### 删除用户
DELETE http://localhost:3000/user/1
content-type: application/json
### 测试 cookies
GET http://localhost:3000/cookies
content-type: application/json
Cookie: name=i love china
### 测试 session
GET http://localhost:3000/s1
content-type: application/json
### 测试token
GET http://localhost:3000/ttt1
content-type: application/json
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb3VudCI6MiwiaWF0IjoxNjkwNDU4ODI3LCJleHAiOjE2OTEwNjM2Mjd9.UHDI6Ofopsqa8fm1n3JBTkA9Tjryrj1Z6fF3gft8EA0
### 生成 token
GET http://localhost:3000/sign
content-type: application/json
### 验证token
GET http://localhost:3000/verify
content-type: application/json
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb3VudCI6MSwiaWF0IjoxNjg5NzMyOTEyLCJleHAiOjE2OTAzMzc3MTJ9.3Vc33qdppRpWxfvDRraeuyKKO21hVsaAIvPxYwUX7PE
### 注册
POST http://localhost:3000/user/register
content-type: application/json
{
"username": "i_love_china_very_much",
"password": "123456"
}
### 登陆
POST http://localhost:3000/user/login
content-type: application/json
{
"username": "name",
"password": "123456"
}
### 测试路由
GET http://localhost:3000/aaa
content-type: application/json
# Cookie: connect.sid=s%3AOVm9tYa_FjRhThWRH3kGo8zkS7JjPPbE.OO4BltOq935eqZWoxPWpEpwKdqz%2BVrEuqrytLrwm1BQ
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJuYW1lIjoi5byg5LiJIiwicm9sZXMiOlt7ImlkIjoxLCJuYW1lIjoi566h55CG5ZGYIiwiY3JlYXRlVGltZSI6IjIwMjMtMDgtMDJUMDM6Mzg6MjguMzUxWiIsInVwZGF0ZVRpbWUiOiIyMDIzLTA4LTAyVDAzOjM4OjI4LjM1MVoifV19LCJpYXQiOjE2OTA5Nzc3MDcsImV4cCI6MTY5MTU4MjUwN30.Ax1c85Q_to7bV2m9gPO9lCTpp9P2byrjEkBVqP-3TVQ
### 测试路由 guard 守卫
GET http://localhost:3000/bbb
content-type: application/json
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsInVzZXJuYW1lIjoibmFtZSIsImlhdCI6MTY5MDk4MjY3NCwiZXhwIjoxNjkwOTgyNzM0fQ.-mA93H1fkvIV-c2dr-cibQEe1StZMZZGz5NefTWRF1M
### 初始化角色数据
GET http://localhost:3000/user/init HTTP/1.1
content-type: application/json
### 测试需要登陆的页面
GET http://localhost:3000/dashboard HTTP/1.1
content-type: application/json
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJuYW1lIjoidXNlcjEiLCJyb2xlcyI6W3siaWQiOjEsIm5hbWUiOiJhZG1pbiIsImNyZWF0ZVRpbWUiOiIyMDIzLTA3LTIxVDAwOjA0OjQyLjc4OVoiLCJ1cGRhdGVUaW1lIjoiMjAyMy0wNy0yMVQwMToyMDozNi45NDZaIn0seyJpZCI6MiwibmFtZSI6InVzZXIiLCJjcmVhdGVUaW1lIjoiMjAyMy0wNy0yMVQwMDowNDo0Mi43OTRaIiwidXBkYXRlVGltZSI6IjIwMjMtMDctMjFUMDE6MjA6MzkuNjQzWiJ9XX0sImlhdCI6MTY4OTkzMTUzMCwiZXhwIjoxNjkwNTM2MzMwfQ.modMDf6-sBxfcRw-5AixS4aNS3ULui866n4DGmwCToY
### 注册用户
POST http://localhost:3000/user/register
content-type: application/json
{
"username": "i_love_china",
"password": "123456",
"email": "907478372@qq.com"
}
### 测试发送邮件
GET http://localhost:3000/email/code?address=907478372@qq.com
content-type: application/json
### 测试邮箱登陆码登陆
POST http://localhost:3000/user/login
content-type: application/json
{
"email": "907478772@qq.com",
"code": "557236"
}
### 发送邮箱验证码
GET http://localhost:3000/email/register_captcha?address=907478371@qq.com
content-type: application/json
### 测试注册用户
POST http://localhost:3000/user/register
content-type: application/json
{
"username": "liu",
"nickName": "dream_liuxs",
"password": "123456",
"email": "907478371@qq.com",
"captcha": "345101"
}
### 查询用户列表
GET http://localhost:3000/user/
content-type: application/json
{
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bailuyeseng/study_nest.git
git@gitee.com:bailuyeseng/study_nest.git
bailuyeseng
study_nest
study_nest
main

搜索帮助