diff --git a/components/profile-data/enka.js b/components/profile-data/enka.js index bfe1a6df..7131e98c 100644 --- a/components/profile-data/enka.js +++ b/components/profile-data/enka.js @@ -9,10 +9,10 @@ let Enka = { let url = diyCfg?.enkaApi?.url || sysCfg.enkaApi.url let profileApi = diyCfg?.enkaApi?.listApi || sysCfg.enkaApi.listApi let api = profileApi({ url, uid, avatar }) - if(diyCfg?.enkaApi?.apiKey) { + if (diyCfg?.enkaApi?.apiKey) { api += '?key=' + diyCfg.enkaApi.apiKey } - let headers = {headers: {'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent}} + let headers = { headers: { 'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent } } let req = await fetch(api, headers) let data = await req.json() if (!data.playerInfo) { diff --git a/config/profile_default.js b/config/profile_default.js index 8bcb0be5..31f5c127 100644 --- a/config/profile_default.js +++ b/config/profile_default.js @@ -7,7 +7,9 @@ /* * Enka面板服务API配置 * * -* 默认地址:https://enka.shinshin.moe/ +* Enka官网:https://enka.shinshin.moe/ +* * +* 其余API待确认后添加 * */ export const enkaApi = { url: 'https://enka.shinshin.moe/', diff --git a/config/system/profile.js b/config/system/profile.js index e8063352..3ff5186c 100644 --- a/config/system/profile.js +++ b/config/system/profile.js @@ -23,6 +23,7 @@ export const miaoApi = { export const enkaApi = { url: 'https://enka.shinshin.moe/', + userAgent: 'Miao-Plugin/3.0', listApi: ({ url, uid }) => { return `${url}u/${uid}/__data.json` }