mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-17 10:08:14 +08:00
✏️ 继续修正 import
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
import getAvatarCollect from "./request/getAvatarCollect";
|
||||
import getAvatarHoldRate from "./request/getAvatarHoldRate";
|
||||
import getAvatarUpRate from "./request/getAvatarUpRate";
|
||||
import getAvatarUseRate from "./request/getAvatarUseRate";
|
||||
import getOverview from "./request/getOverview";
|
||||
import getTeamCollect from "./request/getTeamCollect";
|
||||
import getWeaponCollect from "./request/getWeaponCollect";
|
||||
import uploadData from "./request/uploadData";
|
||||
import { transAvatars, transLocal } from "./utils/transLocal";
|
||||
import getAvatarCollect from "./request/getAvatarCollect.js";
|
||||
import getAvatarHoldRate from "./request/getAvatarHoldRate.js";
|
||||
import getAvatarUpRate from "./request/getAvatarUpRate.js";
|
||||
import getAvatarUseRate from "./request/getAvatarUseRate.js";
|
||||
import getOverview from "./request/getOverview.js";
|
||||
import getTeamCollect from "./request/getTeamCollect.js";
|
||||
import getWeaponCollect from "./request/getWeaponCollect.js";
|
||||
import uploadData from "./request/uploadData.js";
|
||||
import { transAvatars, transLocal } from "./utils/transLocal.js";
|
||||
|
||||
const Hutao = {
|
||||
Abyss: {
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取角色搭配数据
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getAvatarCollect(): Promise<TGApp.Plugins.Hutao.Abyss.AvatarCollocation[]> {
|
||||
const url = HutaoApi.Abyss.avatar.collect;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.AvatarCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.AvatarCollocationResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取角色持有率数据
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getAvatarHoldRate(): Promise<TGApp.Plugins.Hutao.Abyss.AvatarHold[]> {
|
||||
const url = HutaoApi.Abyss.avatar.holdRate;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.AvatarHoldResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.AvatarHoldResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取角色上场率数据
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getAvatarUpRate(): Promise<TGApp.Plugins.Hutao.Abyss.AvatarUp[]> {
|
||||
const url = HutaoApi.Abyss.avatar.upRate;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.AvatarUpResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.AvatarUpResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取角色使用率
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getAvatarUseRate(): Promise<TGApp.Plugins.Hutao.Abyss.AvatarUse[]> {
|
||||
const url = HutaoApi.Abyss.avatar.useRate;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.AvatarUseResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.AvatarUseResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取深渊概览数据
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getOverview(): Promise<TGApp.Plugins.Hutao.Abyss.OverviewData> {
|
||||
const url = HutaoApi.Abyss.overview;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.OverviewResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.OverviewResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import type { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取队伍搭配数据
|
||||
@@ -16,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getTeamCollect(): Promise<TGApp.Plugins.Hutao.Abyss.TeamCombination[]> {
|
||||
const url = HutaoApi.Abyss.team;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.TeamCombinationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.TeamCombinationResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* @file plugins Hutao request getWeaponCollect.ts
|
||||
* @description 获取武器搭配
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import type { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取武器搭配
|
||||
@@ -17,10 +17,8 @@ import HutaoApi from "../api";
|
||||
async function getWeaponCollect(): Promise<TGApp.Plugins.Hutao.Abyss.WeaponCollocation[]> {
|
||||
const url = HutaoApi.Abyss.weapon;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.WeaponCollocationResponse>(url, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((res) => {
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.WeaponCollocationResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import type { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import HutaoApi from "../api";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 上传用户数据
|
||||
@@ -19,11 +20,8 @@ async function uploadData(
|
||||
): Promise<TGApp.Plugins.Hutao.Abyss.UploadResponse> {
|
||||
const url = HutaoApi.Abyss.upload;
|
||||
return await http
|
||||
.fetch<TGApp.Plugins.Hutao.Abyss.UploadResponse>(url, {
|
||||
method: "POST",
|
||||
body: http.Body.json(data),
|
||||
})
|
||||
.then((res) => res.data);
|
||||
.fetch(url, { method: "POST", body: http.Body.json(data) })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.UploadResponse>) => res.data);
|
||||
}
|
||||
|
||||
export default uploadData;
|
||||
|
||||
@@ -86,11 +86,11 @@ function transLevel(data: TGApp.Sqlite.Abyss.Level): TGApp.Plugins.Hutao.Abyss.L
|
||||
const battles: Array<{ Index: number; Avatars: number[] }> = [];
|
||||
battles.push({
|
||||
Index: 1,
|
||||
Avatars: data.upBattle.characters.map((character) => character.id),
|
||||
Avatars: data.upBattle!.characters.map((character) => character.id),
|
||||
});
|
||||
battles.push({
|
||||
Index: 2,
|
||||
Avatars: data.downBattle.characters.map((character) => character.id),
|
||||
Avatars: data.downBattle!.characters.map((character) => character.id),
|
||||
});
|
||||
return {
|
||||
Index: data.id,
|
||||
|
||||
Reference in New Issue
Block a user