查询游戏时长限制信息
- 查询游戏时长限制信息
NPM
$ npm i game-time-query -S
SCRIPT
<script type="text/javascript" src="https://unpkg.com/game-time-query/dist/game-time-query.min.js"></script>
- 执行
const Instance = GameTimeQuery.Instance
获取实例。 - 执行
Instance.fetch({qid, appkey, source}).then(res => {}).catch(err => {})
获取游戏时长信息。
const Instance = GameTimeQuery.Instance;
const params = {
qid: 'qid',
appkey: 'qppkey',
source: 'source',
isJsonp: true
}
Instance.fetch(params)
.then(res => console.log('success', res))
.catch(err => console.error('error', err))
fetch方法用于拉取游戏时长信息,返回promise。
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
qid |
String (必填) |
用户id | --- |
appkey |
String (必填) |
游戏的key | --- |
source |
String (必填) |
来源(sdk_game、page_game、html_game) | --- |
isJsonp | Boolean |
是否用jsonp方式请求 | false |
名称 | 类型 | 描述 |
---|---|---|
isOpen | Boolean |
是否开启 |
isAdult | Boolean |
是否成年 |
allowPlay | Boolean |
是否充许继续玩 |
nextInterval | Number |
下次轮询时间间隔(单位:毫秒)) |
MIT