♻️ 变更目录,参考 TGAssistant 优化一些方法

This commit is contained in:
BTMuli
2023-05-19 09:30:29 +08:00
parent 07056bfec7
commit 824ef681e2
27 changed files with 253 additions and 239 deletions

View File

@@ -0,0 +1,26 @@
/**
* @file web constant TGConstant.ts
* @description 常量
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
import { BBS_VERSION, BBS_HEADER_AGENT, BBS_REFERER } from "./bbs";
import SALT from "./salt";
import SERVER from "./server";
import { GAME_BIZ } from "./utils";
const TGConstant = {
BBS: {
VERSION: BBS_VERSION,
USER_AGENT: BBS_HEADER_AGENT,
REFERER: BBS_REFERER,
},
Salt: SALT,
Server: SERVER,
Utils: {
GAME_BIZ,
},
};
export default TGConstant;

10
src/web/constant/bbs.ts Normal file
View File

@@ -0,0 +1,10 @@
/**
* @file web constant bbs.ts
* @description 常量-应用数据
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
export const BBS_VERSION = "2.49.1";
export const BBS_HEADER_AGENT = `Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) miHoYoBBS/${BBS_VERSION}`;
export const BBS_REFERER = "https://webstatic.mihoyo.com";

25
src/web/constant/salt.ts Normal file
View File

@@ -0,0 +1,25 @@
/**
* @file web constant salt.ts
* @description 用到的 salt 值
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
/**
* @description salt 值
* @version 2.49.1
* @since Alpha v0.2.0
*/
const SALT = {
BBS: {
K2: "egBrFMO1BPBG0UX5XOuuwMRLZKwTVKRV",
LK2: "DG8lqMyc9gquwAUFc7zBS62ijQRX9XF7",
},
Other: {
X4: "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs",
X6: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v",
prod: "JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS",
},
};
export default SALT;

View File

@@ -0,0 +1,32 @@
/**
* @file web constant server.ts
* @description 服务器地址常量文件
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
/**
* @description 服务器地址
* @since Alpha v0.2.0
* @enum {string}
* @readonly
* @property {string} CN_ISLAND 国服-天空岛
* @property {string} CN_TREE 国服-世界树
* @property {string} OS_USA 美服
* @property {string} OS_EURO 欧服
* @property {string} OS_ASIA 亚服
* @property {string} OS_CHT 台服
* @property {string} UNKNOWN 未知
* @returns {string} 服务器地址
*/
enum SERVER {
CN_ISLAND = "cn_gf01",
CN_TREE = "cn_qd01",
OS_USA = "os_usa",
OS_EURO = "os_euro",
OS_ASIA = "os_asia",
OS_CHT = "os_cht",
UNKNOWN = "unknown",
};
export default SERVER;

View File

@@ -0,0 +1,9 @@
/**
* @file web constant utils.ts
* @description 一些杂项的常量
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
// game_biz
export const GAME_BIZ = "hk4e_cn";