mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
Add API key config
This commit is contained in:
parent
f27735d0e0
commit
e6f1621be1
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user