2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

微调说明

This commit is contained in:
ctrlcvs 2022-09-17 22:59:26 +08:00
parent b97309b39a
commit 39341ed59a
2 changed files with 6 additions and 5 deletions

View File

@ -73,4 +73,4 @@ cnpm i promise-retry
- 严禁用于任何商业用途和非法行为 - 严禁用于任何商业用途和非法行为
- Yunzai-Bot 官方QQ群213938015 (暂时停止新加入) - Yunzai-Bot 官方QQ群213938015 (暂时停止新加入)
- 喵喵Miao-Plugin QQ群607710456 (暂时停止新加入) - 喵喵Miao-Plugin QQ群607710456 (暂时停止新加入)
- 图鉴xiaoyao-cvs-Plugin QQ群[544570609](https://jq.qq.com/?_wv=1027&k=GOHommWT) - 图鉴xiaoyao-cvs-Plugin QQ群544570609(暂时不支持加入)

View File

@ -25,6 +25,7 @@ const _path = process.cwd();
let YamlDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yaml`; let YamlDataUrl = `${_path}/plugins/xiaoyao-cvs-plugin/data/yaml`;
let web_api = `https://api-takumi.mihoyo.com` let web_api = `https://api-takumi.mihoyo.com`
let hk4_api = `https://hk4e-api.mihoyo.com`; let hk4_api = `https://hk4e-api.mihoyo.com`;
let bbs_api=`https://bbs-api.mihoyo.com`;
// 米游社的版块 // 米游社的版块
const boards = { const boards = {
honkai3rd: { honkai3rd: {
@ -200,14 +201,14 @@ export default class MihoYoApi {
async forumPostList(forumId) { async forumPostList(forumId) {
const url = const url =
`https://api-takumi.mihoyo.com/post/api/getForumPostList?forum_id=${forumId}&is_good=false&is_hot=false&page_size=20&sort_type=1`; `${web_api}/post/api/getForumPostList?forum_id=${forumId}&is_good=false&is_hot=false&page_size=20&sort_type=1`;
let res = await superagent.get(url).set(this._getHeader()).timeout(10000); let res = await superagent.get(url).set(this._getHeader()).timeout(10000);
let resObj = JSON.parse(res.text); let resObj = JSON.parse(res.text);
return resObj; return resObj;
} }
async forumPostDetail(postId) { async forumPostDetail(postId) {
const url = `https://api-takumi.mihoyo.com/post/api/getPostFull?post_id=${postId}`; const url = `${bbs_api}/post/api/getPostFull?post_id=${postId}`;
let res = await superagent.get(url).set(this._getHeader()).timeout(10000); let res = await superagent.get(url).set(this._getHeader()).timeout(10000);
let resObj = JSON.parse(res.text); let resObj = JSON.parse(res.text);
return resObj; return resObj;
@ -215,13 +216,13 @@ export default class MihoYoApi {
async forumPostShare(postId) { async forumPostShare(postId) {
const url = const url =
`https://api-takumi.mihoyo.com/apihub/api/getShareConf?entity_id=${postId}&entity_type=1`; `${web_api}/apihub/api/getShareConf?entity_id=${postId}&entity_type=1`;
let res = await superagent.get(url).set(this._getHeader()).timeout(10000); let res = await superagent.get(url).set(this._getHeader()).timeout(10000);
let resObj = JSON.parse(res.text); let resObj = JSON.parse(res.text);
return resObj; return resObj;
} }
async forumPostVote(postId) { async forumPostVote(postId) {
const url = `https://api-takumi.mihoyo.com/apihub/sapi/upvotePost`; const url = `${web_api}/apihub/sapi/upvotePost`;
const upvotePostData = { const upvotePostData = {
"post_id": postId, "post_id": postId,
"is_cancel": false "is_cancel": false