Files
StoreWeb/StoreHub/StoreHub.http
T
2026-08-14 18:00:58 +08:00

48 lines
1.2 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@StoreHub_HostAddress = http://localhost:5295
# ============ 认证(JWT) ============
### 登录:返回 accessToken(单点登录,同用户新登录会使旧 token 失效)
# @name login
POST {{StoreHub_HostAddress}}/api/v1/Auth/Login
Content-Type: application/json
{
"userName": "18990011234",
"password": "18990011234"
}
### 获取当前登录用户信息(需携带 Bearer Token,先执行上面的 login)
GET {{StoreHub_HostAddress}}/api/v1/Auth/Me
Authorization: Bearer {{login.response.body.$.data.token}}
### 退出登录:销毁服务端会话,token 立即失效
POST {{StoreHub_HostAddress}}/api/v1/Auth/Logout
Authorization: Bearer {{login.response.body.$.data.token}}
### 在线人员列表(需携带 Bearer Token)
GET {{StoreHub_HostAddress}}/api/v1/Auth/OnlineUsers
Authorization: Bearer {{login.response.body.$.data.token}}
# ============ 示例接口 ============
### 模板自带的 WeatherForecast
GET {{StoreHub_HostAddress}}/api/v1/weatherforecast/
Accept: application/json
POST {{StoreHub_HostAddress}}/api/v1/Auth/Login
Content-Type: application/json
{
//LoginRequest
}
###
POST {{StoreHub_HostAddress}}/api/v1/Auth/Login
Content-Type: application/json
{
//LoginRequest
}