game2006api/doc/AALogin.py
aozhiwei 69fb151673 1
2024-09-25 14:59:08 +08:00

181 lines
8.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import _common
class AALogin(object):
def __init__(self):
self.apis = [
{
'name': 'getNonce',
'desc': '获取Nonce',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=getNonce',
'params': [
['gameid', '', '游戏id'],
['account', '', '钱包账号(oxxxx)'],
],
'response': [
_common.RspHead(),
['nonce', '', 'nonce']
]
},
{
'name': 'getAnnouncement',
'desc': '获得公告内容',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Annc&a=getAnnouncement',
'params': [
['gameid', '', '游戏id'],
['channel', '', '渠道编号'],
['_packageid', 0, '包id 1:android 2:ios'],
['_version', '', '版本号'],
],
'response': [
_common.RspHead(),
['type', 0, '0:无公告 1停服公告(不能进游戏) 2普通公告'],
['title', '', '公告标题'],
['content', '', '公告内容'],
]
},
{
'name': 'auth(待废弃)',
'desc': '登录验证',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=auth',
'params': [
['gameid', '', '游戏id'],
['channel', '', '渠道编号'],
['token', '', '微信:登录时获取的code 手Q:openkey vivo:空'],
['anonymous_token', '', '匿名用户token目前只有头条用到(anonymous\_code)'],
['openid', '', '手Q、vivo登录时需要使用'],
['env', '', 'dev:开发环境 test:测试环境 banshu:版署 其它:正式环境'],
['is_guest', 0, '是否游客登录'],
['pkg_name', '', '只有oppo, vivo需要传'],
['poly_sdk_channel', '', '聚合类sdk channel(当poly\_sdk\_channel不为空时服务器忽略channel参数)'],
['poly_sdk_subchannel', '', '聚合类sdk 子channel(quicksdk时对应channelCode)'],
['type', 0, '只有channel为6516时才有意义(默认0)0:原生登录 1:market登录'],
],
'response': [
_common.RspHead(),
['activated', 0, '是否已激活'],
['session_id', '', '会话id'],
['channel', '', '用户channel'],
['zoneid', '', '用户区id'],
['account_id', '', 'account_id'],
['openid', '', '用户openid'],
['unionid', '', '用户unionid(可能为空)'],
['wid', '', 'weak id弱关系id(可能为空)'],
['sid', '', 'strong id强关系id(可能为空)'],
['ptid', '', 'ptid,一般为手机号(可能为空)'],
['nikename', '', 'nikename'],
['country', '', 'country'],
['province', '', 'province'],
['city', '', 'city'],
['avatar_url', '', 'avatar_url'],
['sex', 0, '性别 0:未设置 1:女 2:男'],
['userinfo_expired', 0, '用户信息是否已过期(目前只有微信平台才有意义其他平台默认返回未过期)'],
['server_time', 0, '回合制专用字段-服务器当前utc时间'],
['server_id', 0, '回合制专用字段-最后登陆的服务器id'],
['server_name', '', '回合制专用字段-最后登陆的服务器名'],
['server_ip', '', '回合制专用字段-最后登陆的服务器ip'],
['is_holiday', 0, '回合制专用字段-是否节假日只有测试服才有该字段!!!'],
['green_time', 0, '回合制专用字段-健康游戏时间(单位小时) 节假日1.5平时3只有测试服才有该字段!!!'],
]
},
{
'method': 'POST',
'name': 'auth2',
'desc': '登录验证(errcode == 505 需要验证码)',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=auth2',
'is_json_params': True,
'params': [
['channel', '', '渠道id 1:immutable 2:游客'],
['data', '', 'channel==1时传jwt channel=2时传客户端本地生成的id该id channel=3洪亮聚合登录的jwt'],
],
'response': [
_common.RspHead(),
['account_id', '', 'account_id'],
['session_id', '', '会话id'],
['server_time', 0, '回合制专用字段-服务器当前utc时间'],
]
},
{
'method': 'POST',
'name': 'verifyAccount',
'desc': '校验账号信息',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=verifyAccount',
'is_json_params': True,
'params': [
['data', '', 'idtoken'],
],
'response': [
_common.RspHead(),
['state', '', '账号状态 1:可以直接进游戏 2:需要兑换码'],
]
},
{
'method': 'POST',
'name': 'useExchangeCode',
'desc': '使用兑换码',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=useExchangeCode',
'is_json_params': True,
'params': [
['exchange_code', '', '兑换码'],
['data', '', 'idtoken'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'getSwitch',
'desc': '获取开关',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=ServerSwitch&a=getSwitch',
'params': [
['gameid', '', '游戏id'],
['_packageid', 0, '包id 1:android 2:ios'],
['_version', '', '版本号'],
],
'response': [
_common.RspHead(),
['examining', 0, '是否审核中'],
]
},
{
'name': 'getWhiteList',
'desc': '获取白名单',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=ServerSwitch&a=getWhiteList',
'params': [
['gameid', '', '游戏id'],
],
'response': [
_common.RspHead(),
['!white_list',[
['id', '', '邮件地址'],
], '白名单']
]
},
]
self.internalApis = [
{
'method': 'POST',
'name': 'verifyJwt',
'desc': 'jwt验证',
'group': '!AALogin',
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=verifyJwt',
'is_json_params': True,
'params': [
['jwt', '', 'jwt'],
],
'response': [
_common.RspHead(),
['account_id', '', 'account_id'],
['address', '', 'address'],
]
},
]