add api for login & checklogin

main
Dawn1Ocean 2024-03-19 23:45:16 +08:00
parent 5c78139d5a
commit f2f4929fc9
2 changed files with 51 additions and 0 deletions

View File

@ -61,6 +61,44 @@ data:
}
```
## 账号登陆
### 微信小程序登陆 `POST /login` OK
- Request
```json
{
"code": "wechat_login_code"
}
```
- Response
```json
{
"success": true,
"token": "your_token"
}
```
### 检查 token 是否登陆 `GET /checklogin?token={token}` OK
```json
{
"islogin": true
}
```
- Response
```json
{
"success": true,
"token": "your_token"
}
```
## 用户页面
### 个人信息 `GET /user/info`

View File

@ -87,4 +87,17 @@ export default {
currentDuty: '3',
},
},
'POST /login': {
success: true,
data: {
token: '__token_test_zjueva1984__',
isMember: true,
},
},
'GET /checklogin': {
success: true,
data: {
islogin: true,
},
},
};