增加用户信息上报接口

This commit is contained in:
zhl 2021-05-20 16:11:21 +08:00
parent 4f1f91e828
commit d2588bf792
3 changed files with 31 additions and 1 deletions

View File

@ -328,6 +328,7 @@
```
### 9. 用户统计信息
1. Method: POST
@ -384,3 +385,32 @@
"examCount": 21 // 参与挑战数量
}
```
### 10. 用户信息上报
1. Method: POST
2. URI: /api/:accountid/login
| 字段 | 说明 |
| -------- | -------------------------------------- |
| accountid | 帐号id |
> POST参数
| 字段 | 说明 |
| -------- | -------------------------------------- |
| nickname | 昵称 |
| avatar | 头像 |
| sex | 性别 |
| country | 国家 |
| province | 省份 |
| city | 城市 |
3. Response: JSON
```js
{
token: '1231231aasa'
}
```

View File

@ -7,6 +7,7 @@ import { getRandom } from '../../utils/number.util'
class GameUserController extends BaseController {
// TODO:: 增加返回未使用的券
@role('anon')
@router('post /api/:accountid/login')
@router('post /weapp/login')
async gameUserLogin(req, res) {
const {accountId} = req.params

View File

@ -32,7 +32,6 @@ class GameUserClass extends BaseModule {
public lockedTime?: Date;
}
export const GameUser = getModelForClass(GameUserClass, {existingConnection: GameUserClass.db});