mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b43a32b600
@ -128,7 +128,7 @@ let Profile = {
|
|||||||
let data = Profile._get(uid, charId);
|
let data = Profile._get(uid, charId);
|
||||||
let Serv = getServ(uid);
|
let Serv = getServ(uid);
|
||||||
if (Serv.getCharData && data && data.id) {
|
if (Serv.getCharData && data && data.id) {
|
||||||
return await Serv.getCharData(uid, data, Profile.saveCharData);
|
return await Serv.getCharData(uid, data, Profile.saveCharData, { config });
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
@ -5,7 +5,7 @@ import moment from "moment";
|
|||||||
import { artiIdx, artiSetMap, attrMap } from "./miao-meta.js";
|
import { artiIdx, artiSetMap, attrMap } from "./miao-meta.js";
|
||||||
import cmeta from "./enka-char.js";
|
import cmeta from "./enka-char.js";
|
||||||
|
|
||||||
const url = "http://49.232.91.210/profile";
|
const url = "http://49.232.91.210/profile/detail?token=kokomi";
|
||||||
|
|
||||||
let Miao = {
|
let Miao = {
|
||||||
key: "miao",
|
key: "miao",
|
||||||
@ -63,12 +63,18 @@ let Miao = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
async getCharData(uid, ds, saveCharData) {
|
async getCharData(uid, ds, saveCharData, { config = {} }) {
|
||||||
if (ds.dataSource !== "miao-pre" || !ds.id) {
|
if (ds.dataSource !== "miao-pre" || !ds.id) {
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let api = `${url}/detail?uid=${uid}&avatar=${ds.id}`;
|
let profileApi = function ({ uid, avatar }) {
|
||||||
|
return `http://49.232.91.210/profile/detail?uid=${uid}&avatar=${avatar}`
|
||||||
|
};
|
||||||
|
if (config.miaoApi && lodash.isFunction(config.miaoApi)) {
|
||||||
|
profileApi = config.miaoApi;
|
||||||
|
}
|
||||||
|
let api = profileApi({ uid, avatar: ds.id });
|
||||||
let req = await fetch(api);
|
let req = await fetch(api);
|
||||||
let data = await req.json();
|
let data = await req.json();
|
||||||
if (data.status === 0 && data.uidData) {
|
if (data.status === 0 && data.uidData) {
|
||||||
|
Loading…
Reference in New Issue
Block a user