Sixth, Authentication and Authorization

6.1 JWT Token Authentication

AnQiCMS uses JWT (JSON Web Token) for user authentication:

  1. The Token is obtained after the user logs in
  2. Include Token in the Header of subsequent requests
  3. Format:Token: {token}

6.2 Interfaces requiring authentication

The following types of interfaces require user authentication:

  • User information management interface
  • Order Management Interface
  • Favorite Management Interface
  • Comment Posting Interface
  • Shopping Cart Management Interface

6.3 Token Acquisition and Refreshing

Token obtained through login interface:

{
  "code": 0,
  "msg": "登录成功",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}