HaniBlindBox/server/HoneyBox/src/HoneyBox.Api/auth.http
2026-01-04 01:47:02 +08:00

212 lines
5.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.

# HoneyBox API
#
@baseUrl = http://localhost:5238/api
@contentType = application/json
# TokenToken
# TokenID: 215832026
# Token
@authToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoi5b6u5L-h55So5oi3MTMxMCIsImV4cCI6MTc2NzQzMTM1OCwidWlkIjoiMzMyMjY2IiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiIyMTU4MyIsImF1ZCI6IkhvbmV5Qm94VXNlcnMiLCJpc3MiOiJIb25leUJveCJ9.700XWIUmzEumNk5tNYRshh7M42A8MG1X4yTHuz9PZbc
### ============================================
### 1.
### ============================================
### 1.1 -
# GET /api/health
GET {{baseUrl}}/health
Accept: {{contentType}}
### ============================================
### 2. (AuthController)
### ============================================
### 2.1
# POST /api/login
# Requirements: 1.1-1.8
# code
POST {{baseUrl}}/login
Content-Type: {{contentType}}
{
"code": "test_wechat_code",
"pid": null,
"clickId": null
}
### 2.2
# POST /api/mobileLogin
# Requirements: 2.1-2.7
# PHPRedis
POST {{baseUrl}}/mobileLogin
Content-Type: {{contentType}}
{
"mobile": "13800138000",
"code": "123456",
"pid": null,
"clickId": null
}
### 2.3 ()
# POST /api/login_bind_mobile
# Requirements: 5.1-5.5
POST {{baseUrl}}/login_bind_mobile
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"code": "wechat_phone_auth_code"
}
### 2.4 ()
# POST /api/bindMobile
# Requirements: 5.1-5.5
POST {{baseUrl}}/bindMobile
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"mobile": "13800138000",
"code": "123456"
}
### 2.5 - POST ()
# POST /api/login_record
# Requirements: 6.1-6.4
POST {{baseUrl}}/login_record
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"device": "android",
"deviceInfo": "Xiaomi Mi 10"
}
### 2.6 - GET ()
# GET /api/login_record
# Requirements: 6.1-6.4
GET {{baseUrl}}/login_record
Authorization: Bearer {{authToken}}
### ============================================
### 3. (UserController)
### ============================================
### 3.1 ()
# POST /api/user
# Requirements: 4.1-4.5
POST {{baseUrl}}/user
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
### 3.2 - ()
# POST /api/update_userinfo
# Requirements: 4.2, 4.3
POST {{baseUrl}}/update_userinfo
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"nickname": ""
}
### 3.3 - URL ()
# POST /api/update_userinfo
# Requirements: 4.2, 4.3
POST {{baseUrl}}/update_userinfo
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"headimg": "https://example.com/avatar.png"
}
### 3.4 - Base64 ()
# POST /api/update_userinfo
# Requirements: 4.2, 4.3
# imagebaseBase64
POST {{baseUrl}}/update_userinfo
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"imagebase": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
### 3.5 - ()
# POST /api/user_log_off
# Requirements: 7.1-7.3
# type=0
POST {{baseUrl}}/user_log_off
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"type": 0
}
### 3.6 - ()
# POST /api/user_log_off
# Requirements: 7.1-7.3
# type=1
POST {{baseUrl}}/user_log_off
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"type": 1
}
### ============================================
### 4.
### ============================================
### 4.1 - code
POST {{baseUrl}}/login
Content-Type: {{contentType}}
{
"code": ""
}
### 4.2 -
POST {{baseUrl}}/mobileLogin
Content-Type: {{contentType}}
{
"mobile": "",
"code": "123456"
}
### 4.3 -
POST {{baseUrl}}/mobileLogin
Content-Type: {{contentType}}
{
"mobile": "13800138000",
"code": ""
}
### 4.4 访 - Token
POST {{baseUrl}}/user
Content-Type: {{contentType}}
### 4.5 访 - Token
POST {{baseUrl}}/update_userinfo
Content-Type: {{contentType}}
{
"nickname": ""
}
### 4.6 访 - Token
POST {{baseUrl}}/bindMobile
Content-Type: {{contentType}}
{
"mobile": "13800138000",
"code": "123456"
}