mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
为enka api的系统配置中增加UA字段
This commit is contained in:
parent
f58ad4fd81
commit
1239cbfae7
@ -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) {
|
||||
|
@ -7,7 +7,9 @@
|
||||
/*
|
||||
* Enka面板服务API配置
|
||||
* *
|
||||
* 默认地址:https://enka.shinshin.moe/
|
||||
* Enka官网:https://enka.shinshin.moe/
|
||||
* *
|
||||
* 其余API待确认后添加
|
||||
* */
|
||||
export const enkaApi = {
|
||||
url: 'https://enka.shinshin.moe/',
|
||||
|
@ -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`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user