Skip to content

Latest commit

 

History

History
138 lines (109 loc) · 5.84 KB

File metadata and controls

138 lines (109 loc) · 5.84 KB

游戏签到 V2

更新时间: 2024.06.25

请求地址

https://api.kurobbs.com/encourage/signIn/v2

请求方式

POST

认证方式

token

请求头

此处版本较老, 请参照其他类似请求

字段 类型 内容 备注
pragma str - no-cache
cache-control str - no-cache
accept str - application/json, text/plain, */*
source str - android
user-agent str UA Mozilla/5.0 (Linux; Android 13; 2211133C Build/TKQ1.220905.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.131 Mobile Safari/537.36 Kuro/1.0.9 KuroGameBox/1.0.9
token str token eyJhbGciOiJIUzI1NiJ9.eyJjcmVhdGVkIjoxNjg5NDk4MDkxMjQ1LCJ1c2VySWQiOjEwMDY1NjY5fQ.AAAA_AAAAAAAAAAAAAAAAAAAAAAAAAAA-AAAAAAAAAA
content-type str application/x-www-form-urlencoded
origin str https://web-static.kurobbs.com
x-requested-with str com.kurogame.kjq
sec-fetch-site str same-site
sec-fetch-mode str cors
sec-fetch-dest str empty
accept-encoding str gzip, deflate, br
accept-language str zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7

请求体

字符串拼接

字段 类型 内容 备注
gameId num 游戏 id 战双 = 2, 鸣潮 = 3
serverId str 服务器 id 星火服 = 1000, 信标服 = ?
roleId num 游戏 uid 46218962
userId num 库洛 id 10065669, 神经病
reqMonth num 签到的月份 07, 什么迷惑参数

响应体

json

根对象

字段 类型 内容 备注
code num 返回值 1511: 重复签到
1505: 活动过期(非当前月份)
220: cookie过期
200: 成功
msg str 提示信息 请求成功/请勿重复签到/用户登录已过期/签到失败, 请刷新页面后重试
success bool true/false token 有效时才有
注意如果被风控, 将报 cookie 过期, 但是返回值包含 success = false; 暂不明确风控原理
data obj 详细信息 签到完成, 成功时才有

data 对象

字段 类型 内容 备注
todayList obj 物品信息 今天签到获得的物品信息
tomorrowList obj 物品信息 明天签到获得的物品信息

todayList tomorrowList 对象

字段 类型 内容 备注
goodsId num 物品 id 30013
goodsNum num 物品数量 5
goodsUrl str 物品图标链接 https://prod-alicdn-community.kurobbs.com/signInIcon/c9db6799fc3541d6af94cc7b1b8ff1e420240518.png
type num (?) 0

示例

请求

const url = 'https://api.kurobbs.com/encourage/signIn/'
const headers = {
    pragma: 'no-cache',
    'cache-control': 'no-cache',
    accept: 'application/json, text/plain, */*',
    source: 'android',
    'user-agent': 'Mozilla/5.0 (Linux; Android 13; 2211133C Build/TKQ1.220905.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.131 Mobile Safari/537.36 Kuro/1.0.9 KuroGameBox/1.0.9',
    token: 'eyJhbGciOiJIUzI1NiJ9.eyJjcmVhdGVkIjoxNjg5NDk4MDkxMjQ1LCJ1c2VySWQiOjEwMDY1NjY5fQ.AAAA_AAAAAAAAAAAAAAAAAAAAAAAAAAA-AAAAAAAAAA',
    'content-type': 'application/x-www-form-urlencoded',
    origin: 'https://web-static.kurobbs.com',
    'x-requested-with': 'com.kurogame.kjq',
    'sec-fetch-site': 'same-site',
    'sec-fetch-mode': 'cors',
    'sec-fetch-dest': 'empty',
    'accept-encoding': 'gzip, deflate, br',
    'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
}

const formData = new URLSearchParams()
formData.append('gameId', 2)
formData.append('serverId', 1000)
formData.append('roleId', 46218962)
formData.append('reqMonth', '07')
try {
    const response = await fetch(url, {
        method: 'POST',
        headers: headers,
        body: formData,
    })

    if (!response.ok) {
        console.error('fetch error: ', response.status, response.statusText)
    }

    const rsp = await response.json()

    if (rsp.code === 200) {
        console.info('api rsp:', JSON.stringify(rsp))
    } else {
        console.error('api error:', JSON.stringify(rsp))
    }
} catch (error) {
    console.error('fetch error:', error)
}

响应

{
  "code": 200,
  "data": "签到完成",
  "msg": "请求成功",
  "success": true
}