From e6f1621be1e0224d652161aa8905cdc3ac49b5e1 Mon Sep 17 00:00:00 2001 From: Algoinde Date: Fri, 29 Jul 2022 19:59:25 +0500 Subject: [PATCH] Add API key config --- components/profile-data/enka.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/profile-data/enka.js b/components/profile-data/enka.js index d5e5beaf..bfe1a6df 100644 --- a/components/profile-data/enka.js +++ b/components/profile-data/enka.js @@ -9,6 +9,9 @@ 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) { + api += '?key=' + diyCfg.enkaApi.apiKey + } let headers = {headers: {'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent}} let req = await fetch(api, headers) let data = await req.json()