User login
The user inputs the account and password, and the successfully logged-in token is returned. The validity period is determined by the deadTime, which is 1 day by default. After the prompt for expiration, the user needs to log in again to get it for subsequent interface calls. The token is a Bearer token, which should be placed in the Authorization header when calling other interfaces. Note that "Bearer " and a space should be added before the token.
Request parameter
field | type | required | desc |
---|---|---|---|
userName | string | Yes | username |
password | string | Yes | MD5 password,notice is letter |
Response Data (type:object)
field | type | desc |
---|---|---|
userType | integer | User type: 2: Service administrator (basic information can be changed) 3: ordinary users; 5: Plat No. login |
token | string | JWT token |
deadTime | integer | token invalid time |
Example
Request example
url
http://localhost:8080/basic_api/v1/login?userName=xx&password=43a9b5af17202b5f18ce53006251293b&_t=1698998015041
http://localhost:8080/basic_api/v1/login?userName=xx&password=43a9b5af17202b5f18ce53006251293b&_t=1698998015041
Response example
json
{
"hdr": {
"code": 200,
"message": "success"
},
"data": {
"userType": 2,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbkd1aWQiOjYsInVzZXJHdWlkIjo2LCJ1c2VyTmFtZSI6ImxjYWRtaW4iLCJ1c2VyVHlwZSI6MiwibWF4RGV2aWNlTnVtIjo1MDAsIlRva2VuU3RyaW5nIjoiIiwiaXNzIjoibHl6IiwiZXhwIjoxNjk5MDg0NDAxfQ.oWB6nUUyEJo-ZcQEYUCPb0Td9TLbs43N8l3Jw-4zd_4",
"deadTime": 1695703878
}
}
{
"hdr": {
"code": 200,
"message": "success"
},
"data": {
"userType": 2,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbkd1aWQiOjYsInVzZXJHdWlkIjo2LCJ1c2VyTmFtZSI6ImxjYWRtaW4iLCJ1c2VyVHlwZSI6MiwibWF4RGV2aWNlTnVtIjo1MDAsIlRva2VuU3RyaW5nIjoiIiwiaXNzIjoibHl6IiwiZXhwIjoxNjk5MDg0NDAxfQ.oWB6nUUyEJo-ZcQEYUCPb0Td9TLbs43N8l3Jw-4zd_4",
"deadTime": 1695703878
}
}