System Settings
Interfaces for managing system configurations.
Get System Settings
Get all system configurations.
Interface Information
- Endpoint:
GET /api/admin/settings - Authentication: Required (admin permission)
Response Fields
| Field Name | Type | Description |
|---|---|---|
| siteName | string | Website name |
| siteDescription | string | Website description |
| siteKeywords | array | Website keywords |
| authorName | string | Author name |
| authorAvatar | string | Author avatar URL |
| socialLinks | object | Social media links |
| pageSize | number | Items per page |
| allowComments | boolean | Whether comments are allowed |
Update System Settings
Update system configurations.
Interface Information
- Endpoint:
PUT /api/admin/settings - Authentication: Required (admin permission)
Request Parameters
All fields optional, only passed fields will be updated.
Request Example
bash
curl -X PUT http://localhost:3000/api/admin/settings \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"siteName": "My Blog",
"allowComments": true
}'Clear Cache
Clear system cache.
Interface Information
- Endpoint:
POST /api/admin/settings/clear-cache - Authentication: Required (admin permission)
Request Example
bash
curl -X POST http://localhost:3000/api/admin/settings/clear-cache \
-H "Authorization: Bearer your-jwt-token"Error Responses
| HTTP Status Code | Description |
|---|---|
| 401 | Not logged in or token invalid |
| 403 | Insufficient permission (non-admin) |
| 400 | Parameter error |
| 500 | Server error |