Update enka.js

This commit is contained in:
Algoinde 2022-07-29 19:51:10 +05:00 committed by GitHub
parent 845e69bf78
commit f27735d0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,8 @@ let Enka = {
let url = diyCfg?.enkaApi?.url || sysCfg.enkaApi.url let url = diyCfg?.enkaApi?.url || sysCfg.enkaApi.url
let profileApi = diyCfg?.enkaApi?.listApi || sysCfg.enkaApi.listApi let profileApi = diyCfg?.enkaApi?.listApi || sysCfg.enkaApi.listApi
let api = profileApi({ url, uid, avatar }) let api = profileApi({ url, uid, avatar })
let req = await fetch(api) let headers = {headers: {'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent}}
let req = await fetch(api, headers)
let data = await req.json() let data = await req.json()
if (!data.playerInfo) { if (!data.playerInfo) {
e.reply(`请求失败:${data.msg || '可能是面板服务并发过高,请稍后重试'}`) e.reply(`请求失败:${data.msg || '可能是面板服务并发过高,请稍后重试'}`)