mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-01 06:39:45 +08:00
🐛 修复部分 eslint 报错
This commit is contained in:
@@ -26,12 +26,14 @@ export async function getGameRoleListByLToken(
|
||||
const uid = account.gameUid;
|
||||
// eslint-disable-next-line camelcase
|
||||
const data = { role_id: uid, server: TGUtils.Tools.getServerByUid(uid) };
|
||||
const header = TGUtils.User.getHeader(
|
||||
cookie as unknown as Record<string, string>,
|
||||
"POST",
|
||||
JSON.stringify(data),
|
||||
"common",
|
||||
);
|
||||
// 格式转换 将 cookie 对象转换 record<string, string>
|
||||
const ck: Record<string, string> = {
|
||||
account_id: cookie.account_id,
|
||||
cookie_token: cookie.cookie_token,
|
||||
ltuid: cookie.ltuid,
|
||||
ltoken: cookie.ltoken,
|
||||
};
|
||||
const header = TGUtils.User.getHeader(ck, "POST", JSON.stringify(data), "common");
|
||||
return await http
|
||||
.fetch<TGApp.Game.Character.ListResponse>(url, {
|
||||
method: "POST",
|
||||
|
||||
@@ -18,7 +18,7 @@ import { transCookie, transParams } from "./tools";
|
||||
* @param {string} saltType salt 类型
|
||||
* @returns {string} salt
|
||||
*/
|
||||
function getSalt(saltType: string) {
|
||||
function getSalt(saltType: string): string {
|
||||
switch (saltType) {
|
||||
case "common":
|
||||
return TGConstant.Salt.Other.X4;
|
||||
|
||||
@@ -33,7 +33,7 @@ export function decodeRegExp(data: string): string {
|
||||
* @param {Record<string, string>} cookie cookie
|
||||
* @returns {string} 转换后的 cookie
|
||||
*/
|
||||
export function transCookie(cookie: Record<string, string>) {
|
||||
export function transCookie(cookie: Record<string, string>): string {
|
||||
let res = "";
|
||||
for (const key of Object.keys(cookie).sort()) {
|
||||
res += `${key}=${cookie[key]};`;
|
||||
|
||||
Reference in New Issue
Block a user