"按页面分类的接口设计:登录与注册接口详解"

需积分: 0 0 下载量 100 浏览量 更新于2024-02-01 收藏 615KB PDF 举报
ording to the interface design classified by page (request URL, input, output), the login page interface is designed with the following specifications: URL: /account/login Request Method: POST Request Parameters: - u_id: Student ID/Employee Number/Administrator Number (String, required) - password: Password (String, required, encrypted with MD5) Return Parameters: - code: * 200: Login successful * 208: User ID does not exist * 209: Incorrect password (Integer) - message: * 200: token with user information * 208: "User ID does not exist" * 209: "Incorrect password" (String) Additional Notes: When making requests to APIs other than /api/login, /api/register, and /api/searchId, the pbl_token must be carried in the header for identity verification. If the user's login status exceeds two hours, the token will become invalid. The token is designed as follows: u_id_millisecond_password_Last5ofMD5 (e.g., 12345_5000_AB2DC) Additionally, there is a user object serialized into a JSON string, containing properties such as u_id, type, u_name, gender, and description. When the code is 200, the image URL is carried, otherwise it is null. With these specifications in place, the registration page interface is also defined with the following details: URL: /acc Request Method: POST Request Parameters: - u_id: Student ID (Integer, required) In conclusion, the interface design classified by page provides clear guidelines for the request URL, input, and output for the login and registration pages. It involves the essential parameters such as user ID, password, and token for authentication and security purposes. This detailed design ensures the smooth operation and secure authentication of the system.