修改用户信息接口, 调整代币的数据结构
This commit is contained in:
parent
14087f02db
commit
f92af1cd1f
15
docs/api.md
15
docs/api.md
@ -40,15 +40,12 @@
|
||||
trial: false, // 是否是试用
|
||||
trial_expire: 1609919293, // 试用到期时间, 0: 说明是永久
|
||||
}],
|
||||
moneys: {
|
||||
'coin': 0, // 金币
|
||||
'diamond': 0, // 钻石
|
||||
'hero_shard': 0, // 通用英雄碎片
|
||||
'hero_exp': 0, // 通用英雄经验
|
||||
'hero_shard_heroid': 0, // 英雄专用碎片
|
||||
'hero_exp_heroid': 0, // 英雄专用经验
|
||||
'card_scroll': 0, //抽卡卷轴
|
||||
},
|
||||
moneys: [
|
||||
{
|
||||
"itemid": 80012, //代币的id
|
||||
"itemnum": 140 // 数量
|
||||
}
|
||||
],
|
||||
normal_stat: [0, 0, 0, 0] //匹配: 胜利场数, 失败场数, 平局场数, 掉线场数
|
||||
season_rank: 1 // 当前赛季排名
|
||||
match_score: 1000 //当前匹配分, 用于匹配时上传
|
||||
|
@ -7,8 +7,6 @@ import { BaseConst } from '../constants/BaseConst'
|
||||
import { Hero } from '../models/subdoc/Hero'
|
||||
import { CardGroup } from '../models/CardGroup'
|
||||
import { BagItem, ItemType } from '../models/BagItem'
|
||||
import ItemCtrl from '../logic/ItemCtrl'
|
||||
import { ItemInfo } from '../logic/ItemDef'
|
||||
|
||||
export default class AccountController extends BaseController {
|
||||
@role('anon')
|
||||
@ -72,7 +70,8 @@ export default class AccountController extends BaseController {
|
||||
|
||||
result.heros = heros
|
||||
await account.save()
|
||||
result.moneys = account.moneys
|
||||
const moneyList = await BagItem.find({accountid, itemtype: ItemType.MONEY})
|
||||
result.moneys = moneyList.map(o => o.toJson())
|
||||
result.normal_stat = account.normal_stat
|
||||
result.extinfo = account.extinfo
|
||||
result.season_score = account.season_score
|
||||
|
Loading…
x
Reference in New Issue
Block a user