mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-25 05:29:45 +08:00
🌈 style(eslint): 第三次格式化
camecase 回头在部分文件 ignore 掉,不然不兼容之前的版本及外部接口 (cherry picked from commit 740b4698e916ce0f7911f5eac934183a94288e61)
This commit is contained in:
@@ -19,7 +19,7 @@ const ANNO_LIST_API = `${Hk4eAnnoApi}/getAnnList?`;
|
||||
const ANNO_CONTENT_API = `${Hk4eAnnoApi}/getAnnContent?`;
|
||||
// 公告 Query
|
||||
const ANNO_QUERY =
|
||||
"game=hk4e&game_biz=hk4e_cn&lang=zh-cn&bundle_id=hk4e_cn&platform=pc®ion=cn_gf01&level=60&uid=500299765";
|
||||
"game=hk4e&game_biz=hk4e_cn&lang=zh-cn&bundle_id=hk4e_cn&platform=pc®ion=cn_gf01&level=60&uid=500299765";
|
||||
|
||||
/**
|
||||
* @description 获取游戏内公告列表
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* @returns {string} API
|
||||
*/
|
||||
export const OBC_CONTENT_API =
|
||||
"https://bbs.mihoyo.com/ys/obc/content/{content_id}/detail?bbs_presentation_style=no_header";
|
||||
"https://bbs.mihoyo.com/ys/obc/content/{content_id}/detail?bbs_presentation_style=no_header";
|
||||
|
||||
// 杂项接口
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { type NewsData, type NewsResponse } from "../interface/news";
|
||||
|
||||
// 咨讯 API
|
||||
const NEWS_LIST_API =
|
||||
"https://bbs-api.mihoyo.com/post/wapi/getNewsList?gids={gid}&page_size={page_size}&type={news_type}&last_id={last_id}";
|
||||
"https://bbs-api.mihoyo.com/post/wapi/getNewsList?gids={gid}&page_size={page_size}&type={news_type}&last_id={last_id}";
|
||||
|
||||
/**
|
||||
* @description 咨讯类型
|
||||
@@ -53,11 +53,7 @@ export async function getNoticeList (gid: string = "2", pageSize: number = 20, l
|
||||
* @param {number} lastId 上一次请求的最后一条数据的 id
|
||||
* @return {Promise<NewsData>}
|
||||
*/
|
||||
export async function getActivityList (
|
||||
gid: string = "2",
|
||||
pageSize: number = 20,
|
||||
lastId: number = 0,
|
||||
): Promise<NewsData> {
|
||||
export async function getActivityList (gid: string = "2", pageSize: number = 20, lastId: number = 0): Promise<NewsData> {
|
||||
const url = NEWS_LIST_API.replace("{page_size}", pageSize.toString())
|
||||
.replace("{gid}", gid)
|
||||
.replace("{news_type}", NewsType.ACTIVITY)
|
||||
|
||||
@@ -231,13 +231,13 @@ function DividerParser (data: PostStructuredContent): HTMLDivElement {
|
||||
const img = document.createElement("img");
|
||||
if (data.insert.divider === "line_1") {
|
||||
img.src =
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/40eb5281cb24042bf34a9f1bcc61eaf5.png";
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/40eb5281cb24042bf34a9f1bcc61eaf5.png";
|
||||
} else if (data.insert.divider === "line_2") {
|
||||
img.src =
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/477d4c535e965bec1791203aecdfa8e6.png";
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/477d4c535e965bec1791203aecdfa8e6.png";
|
||||
} else if (data.insert.divider === "line_3") {
|
||||
img.src =
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/e7047588e912d60ff87a975e037c7606.png";
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2021/01/05/e7047588e912d60ff87a975e037c7606.png";
|
||||
} else if (data.insert.divider === "line_4") {
|
||||
img.src = "https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2022/07/13/line_4.png";
|
||||
} else {
|
||||
@@ -265,13 +265,13 @@ function ImageParser (data: PostStructuredContent): HTMLDivElement {
|
||||
throw new Error("data.insert.image is not defined");
|
||||
}
|
||||
// if (!data.attributes) {
|
||||
// throw new Error("data.attributes is not defined");
|
||||
// throw new Error("data.attributes is not defined");
|
||||
// }
|
||||
// if (!data.attributes.width) {
|
||||
// throw new Error("data.attributes.width is not defined");
|
||||
// throw new Error("data.attributes.width is not defined");
|
||||
// }
|
||||
// if (!data.attributes.height) {
|
||||
// throw new Error("data.attributes.height is not defined");
|
||||
// throw new Error("data.attributes.height is not defined");
|
||||
// }
|
||||
const div = document.createElement("div");
|
||||
// 创建图片
|
||||
|
||||
Reference in New Issue
Block a user