-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
255 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/** | ||
* @file web request TGRequest.ts | ||
* @description 应用用到的请求函数 | ||
* @author BTMuli <[email protected]> | ||
* @since Beta v0.3.0 | ||
* @since Beta v0.3.4 | ||
*/ | ||
|
||
import { genAuthkey } from "./genAuthkey"; | ||
import { getAbyss } from "./getAbyss"; | ||
import { getActionTicketBySToken } from "./getActionTicket"; | ||
import { getAnnoContent, getAnnoList } from "./getAnno"; | ||
import { getCookieTokenByGameToken, getCookieTokenBySToken } from "./getCookieToken"; | ||
// import * from "./getEnkaData.ts"; | ||
|
@@ -48,6 +48,7 @@ const TGRequest = { | |
getAccounts: getGameAccountsBySToken, | ||
getCookieToken: getCookieTokenBySToken, | ||
getLToken: getLTokenBySToken, | ||
getActionTicket: getActionTicketBySToken, | ||
}, | ||
bgGameToken: { | ||
getCookieToken: getCookieTokenByGameToken, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @file web/request/getActionTicket.ts | ||
* @description 获取米游社动态的 ActionTicket | ||
* @since Beta v0.3.4 | ||
*/ | ||
|
||
import { http } from "@tauri-apps/api"; | ||
|
||
import TGUtils from "../utils/TGUtils"; | ||
|
||
/** | ||
* @description 通过 stoken 获取 ActionTicket | ||
* @since Beta v0.3.4 | ||
* @todo 类型完善 | ||
* @param {string} ActionType 动作类型 | ||
* @param {string} SToken stoken | ||
* @param {string} MID 用户 MID | ||
* @param {string} UID 用户 UID | ||
* @returns {Promise<TGApp.BBS.Response.Base>} | ||
*/ | ||
export async function getActionTicketBySToken( | ||
ActionType: string, | ||
SToken: string, | ||
MID: string, | ||
UID: string, | ||
): Promise<TGApp.BBS.Response.Base> { | ||
const url = "https://api-takumi.mihoyo.com/auth/api/getActionTicketBySToken"; | ||
const params = { | ||
action_type: ActionType, | ||
stoken: SToken, | ||
uid: UID, | ||
}; | ||
const cookie = { | ||
mid: MID, | ||
stoken: SToken, | ||
}; | ||
const header = TGUtils.User.getHeader(cookie, "GET", params, "k2"); | ||
return await http | ||
.fetch<TGApp.BBS.Response.Base>(url, { | ||
method: "GET", | ||
headers: header, | ||
query: params, | ||
}) | ||
.then((res) => { | ||
return res.data; | ||
}); | ||
} |
Oops, something went wrong.