Skip to content

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 NameTypeDescription
siteNamestringWebsite name
siteDescriptionstringWebsite description
siteKeywordsarrayWebsite keywords
authorNamestringAuthor name
authorAvatarstringAuthor avatar URL
socialLinksobjectSocial media links
pageSizenumberItems per page
allowCommentsbooleanWhether 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 CodeDescription
401Not logged in or token invalid
403Insufficient permission (non-admin)
400Parameter error
500Server error