fix: 修复绑定ck出错问题。 (#100)
Co-authored-by: Kokomi <102026640+yoimiya-kokomi@users.noreply.github.com>
This commit is contained in:
parent
7f49a92665
commit
f1b8466695
|
@ -378,12 +378,26 @@ export default class MysUser extends BaseModel {
|
||||||
mys: 'https://api-takumi.mihoyo.com/binding/api/getUserGameRolesByCookie',
|
mys: 'https://api-takumi.mihoyo.com/binding/api/getUserGameRolesByCookie',
|
||||||
hoyolab: 'https://api-os-takumi.mihoyo.com/binding/api/getUserGameRolesByCookie?game_biz=hk4e_global'
|
hoyolab: 'https://api-os-takumi.mihoyo.com/binding/api/getUserGameRolesByCookie?game_biz=hk4e_global'
|
||||||
}
|
}
|
||||||
|
let list=[];
|
||||||
|
let result;
|
||||||
|
if(serv=='mys'){
|
||||||
|
for(let item of biz){
|
||||||
|
result=await fetch(url[serv]+item, { method: 'get', headers: { Cookie: ck } })
|
||||||
|
if(result.ok){
|
||||||
|
result=await result.json()
|
||||||
|
if(result?.data?.list.length>0){
|
||||||
|
list.push(...result.data.list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!result?.data) result = { data: {} };
|
||||||
|
result.data.list = list
|
||||||
|
}else{
|
||||||
let res = await fetch(url[serv], { method: 'get', headers: { Cookie: ck } })
|
let res = await fetch(url[serv], { method: 'get', headers: { Cookie: ck } })
|
||||||
if (!res.ok) return false
|
if (!res.ok) return false
|
||||||
res = await res.json()
|
result = await res.json()
|
||||||
|
}
|
||||||
return res
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取米游社通行证id
|
// 获取米游社通行证id
|
||||||
|
|
Loading…
Reference in New Issue