代码拉取完成,页面将自动刷新
同步操作将从 刘学帅/study_nest 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# 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
{
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。