mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-06 08:32:51 +08:00
🐛 Tauri.Genshin → TeyvatGuide
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Tauri.Genshin</title>
|
||||
<title>TeyvatGuide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/**
|
||||
* @file plugins Hutao utils transLocal.ts
|
||||
* @file plugins/Hutao/utils/transLocal.ts
|
||||
* @description 将本地数据转为上传用的数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.2
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description 将本地数据转为上传用的数据
|
||||
* @since Alpha v0.2.1
|
||||
* @since Beta v0.3.4
|
||||
* @param {TGApp.Sqlite.Abyss.SingleTable} data 本地数据
|
||||
* @returns {TGApp.Plugins.Hutao.Abyss.RecordUpload} 上传用的数据
|
||||
*/
|
||||
@@ -16,7 +15,7 @@ export function transLocal(
|
||||
): TGApp.Plugins.Hutao.Abyss.RecordUpload {
|
||||
return {
|
||||
Uid: data.uid,
|
||||
Identity: "Tauri.Genshin",
|
||||
Identity: "TeyvatGuide",
|
||||
SpiralAbyss: transAbyss(data),
|
||||
Avatars: [],
|
||||
ReservedUserName: "",
|
||||
|
||||
9
src/types/App/Achievement.d.ts
vendored
9
src/types/App/Achievement.d.ts
vendored
@@ -1,8 +1,7 @@
|
||||
/**
|
||||
* @file types App Achievement.d.ts
|
||||
* @file types/App/Achievement.d.ts
|
||||
* @description 应用成就相关类型定义文件
|
||||
* @todo https://github.com/BTMuli/Tauri.Genshin/issues/19
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @todo https://github.com/BTMuli/TeyvatGuide/issues/19
|
||||
* @since Alpha v0.1.5
|
||||
*/
|
||||
|
||||
@@ -20,7 +19,7 @@ declare namespace TGApp.App.Achievement {
|
||||
* @property {string} version - 成就版本
|
||||
* @return Item
|
||||
*/
|
||||
export interface Item {
|
||||
interface Item {
|
||||
id: number;
|
||||
series: number;
|
||||
order: number;
|
||||
@@ -41,7 +40,7 @@ declare namespace TGApp.App.Achievement {
|
||||
* @property {string} icon - 成就系列图标
|
||||
* @return Series
|
||||
*/
|
||||
export interface Series {
|
||||
interface Series {
|
||||
id: number;
|
||||
order: number;
|
||||
name: string;
|
||||
|
||||
15
src/types/BBS/Constant.d.ts
vendored
15
src/types/BBS/Constant.d.ts
vendored
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @file types BBS Constant.d.ts
|
||||
* @file types/BBS/Constant.d.ts
|
||||
* @description BBS 常量相关类型定义文件
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.6
|
||||
*/
|
||||
|
||||
@@ -28,12 +27,12 @@ declare namespace TGApp.BBS.Constant {
|
||||
* @property {string} stoken stoken
|
||||
* @property {string} stuid stoken 对应的 uid
|
||||
* @description stoken_v2 与 mid 一起使用,这是新版本的 token
|
||||
* @see https://github.com/BTMuli/Tauri.Genshin/issues/18
|
||||
* @see https://github.com/BTMuli/TeyvatGuide/issues/18
|
||||
* @property {string} stoken_v2 stoken_v2
|
||||
* @property {string} mid mid
|
||||
* @return Cookie
|
||||
*/
|
||||
export interface Cookie {
|
||||
interface Cookie {
|
||||
login_ticket: string;
|
||||
login_uid: string;
|
||||
account_id: string;
|
||||
@@ -54,7 +53,7 @@ declare namespace TGApp.BBS.Constant {
|
||||
* @property {string} login_uid 登录 uid
|
||||
* @return CookieGroup1
|
||||
*/
|
||||
export interface CookieGroup1 {
|
||||
interface CookieGroup1 {
|
||||
login_ticket: string;
|
||||
login_uid: string;
|
||||
}
|
||||
@@ -67,7 +66,7 @@ declare namespace TGApp.BBS.Constant {
|
||||
* @property {string} cookie_token cookie token
|
||||
* @return CookieGroup2
|
||||
*/
|
||||
export interface CookieGroup2 {
|
||||
interface CookieGroup2 {
|
||||
account_id: string;
|
||||
cookie_token: string;
|
||||
}
|
||||
@@ -80,7 +79,7 @@ declare namespace TGApp.BBS.Constant {
|
||||
* @property {string} ltuid ltoken 对应的 uid
|
||||
* @return CookieGroup3
|
||||
*/
|
||||
export interface CookieGroup3 {
|
||||
interface CookieGroup3 {
|
||||
ltoken: string;
|
||||
ltuid: string;
|
||||
}
|
||||
@@ -93,5 +92,5 @@ declare namespace TGApp.BBS.Constant {
|
||||
* @extends CookieGroup3
|
||||
* @return CookieGroup4
|
||||
*/
|
||||
export interface CookieGroup4 extends CookieGroup2, CookieGroup3 {}
|
||||
interface CookieGroup4 extends CookieGroup2, CookieGroup3 {}
|
||||
}
|
||||
|
||||
9
src/types/Sqlite/Achievement.d.ts
vendored
9
src/types/Sqlite/Achievement.d.ts
vendored
@@ -1,8 +1,7 @@
|
||||
/**
|
||||
* @file types Sqlite Achievement.d.ts
|
||||
* @file types/Sqlite/Achievement.d.ts
|
||||
* @description 数据库成就相关类型定义文件
|
||||
* @todo https://github.com/BTMuli/Tauri.Genshin/issues/19
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @todo https://github.com/BTMuli/TeyvatGuide/issues/19
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
@@ -24,7 +23,7 @@ declare namespace TGApp.Sqlite.Achievement {
|
||||
* @property {string} updated - 数据库更新时间
|
||||
* @return SingleTable
|
||||
*/
|
||||
export interface SingleTable {
|
||||
interface SingleTable {
|
||||
id: number;
|
||||
series: number;
|
||||
order: number;
|
||||
@@ -52,7 +51,7 @@ declare namespace TGApp.Sqlite.Achievement {
|
||||
* @property {string} updated - 数据库更新时间
|
||||
* @returns SeriesTable
|
||||
*/
|
||||
export interface SeriesTable {
|
||||
interface SeriesTable {
|
||||
id: number;
|
||||
order: number;
|
||||
name: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file utils UIAF.ts
|
||||
* @file utils/UIAF.ts
|
||||
* @description UIAF工具类
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
import { app, fs, path } from "@tauri-apps/api";
|
||||
@@ -29,12 +29,12 @@ export function getUiafStatus(completed: boolean, progress: number): number {
|
||||
|
||||
/**
|
||||
* @description 获取 UIAF 头部信息
|
||||
* @since Alpha v0.1.3
|
||||
* @since Beta v0.3.4
|
||||
* @returns {Promise<TGApp.Plugins.UIAF.Export>}
|
||||
*/
|
||||
export async function getUiafHeader(): Promise<TGApp.Plugins.UIAF.Export> {
|
||||
return {
|
||||
export_app: "Tauri.Genshin",
|
||||
export_app: "TeyvatGuide",
|
||||
export_timestamp: Math.floor(Date.now() / 1000),
|
||||
export_app_version: await app.getVersion(),
|
||||
uiaf_version: "v1.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file utils UIGF.ts
|
||||
* @file utils/UIGF.ts
|
||||
* @description UIGF工具类
|
||||
* @since Beta v0.3.0
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
import { app, fs, path } from "@tauri-apps/api";
|
||||
@@ -10,7 +10,7 @@ import { timestampToDate } from "./t2D";
|
||||
|
||||
/**
|
||||
* @description 获取 UIGF 头部信息
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
* @param {string} uid - UID
|
||||
* @returns {Promise<TGApp.Plugins.UIGF.Export>}
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ export async function getUigfHeader(uid: string): Promise<TGApp.Plugins.UIGF.Exp
|
||||
uigf_version: "2.3.0",
|
||||
export_timestamp: Math.floor(stamp / 1000),
|
||||
export_time: timestampToDate(stamp),
|
||||
export_app: "Tauri.Genshin",
|
||||
export_app: "TeyvatGuide",
|
||||
export_app_version: await app.getVersion(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file web request getSyncAvatarDetail.ts
|
||||
* @file web/request/getSyncAvatarDetail.ts
|
||||
* @description 获取同步角色详情相关请求函数
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
import { app, http } from "@tauri-apps/api";
|
||||
@@ -11,7 +11,7 @@ import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
* @description 获取同步角色详情
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
* @param {TGApp.BBS.Constant.CookieGroup2} cookie cookie
|
||||
* @param {string} uid 用户 uid
|
||||
* @param {number} avatarId 角色 id
|
||||
@@ -34,7 +34,7 @@ async function getSyncAvatarDetail(
|
||||
};
|
||||
const version = await app.getVersion();
|
||||
const header = {
|
||||
"User-Agent": `Tauri.Genshin/${version}`,
|
||||
"User-Agent": `TeyvatGuide/${version}`,
|
||||
Referer: "https://webstatic.mihoyo.com/",
|
||||
Cookie: TGUtils.Tools.transCookie(ck),
|
||||
};
|
||||
@@ -45,8 +45,8 @@ async function getSyncAvatarDetail(
|
||||
query: params,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.retcode !== 0) return <TGApp.BBS.Response.Base>res.data;
|
||||
return <TGApp.Game.Calculate.AvatarDetail>res.data.data;
|
||||
if (res.data.retcode !== 0) return res.data;
|
||||
return res.data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file web request getSyncAvatarListAll.ts
|
||||
* @file web/request/getSyncAvatarListAll.ts
|
||||
* @description 获取同步角色列表请求
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
import { app, http } from "@tauri-apps/api";
|
||||
@@ -11,7 +11,7 @@ import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
* @description 获取同步角色列表请求
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.4
|
||||
* @param {Record<string,string>} cookie cookie
|
||||
* @param {string} uid 用户 uid
|
||||
* @param {number} page 页码
|
||||
@@ -30,7 +30,7 @@ async function getSyncAvatarList(
|
||||
};
|
||||
const version = await app.getVersion();
|
||||
const header = {
|
||||
"User-Agent": `Tauri.Genshin/${version}`,
|
||||
"User-Agent": `TeyvatGuide/${version}`,
|
||||
Referer: "https://webstatic.mihoyo.com/",
|
||||
Cookie: TGUtils.Tools.transCookie(cookie),
|
||||
};
|
||||
@@ -41,8 +41,8 @@ async function getSyncAvatarList(
|
||||
headers: header,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.retcode !== 0) return <TGApp.BBS.Response.Base>res.data;
|
||||
return <TGApp.Game.Calculate.AvatarListItem[]>res.data.data.list;
|
||||
if (res.data.retcode !== 0) return res.data;
|
||||
return res.data.data.list;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user