refactor: impl structs methods

This commit is contained in:
GyDi
2022-01-07 23:29:20 +08:00
parent 72ff261fe3
commit e369311fc2
21 changed files with 676 additions and 762 deletions

View File

@@ -13,8 +13,8 @@ export async function getAxios() {
try {
const info = await getClashInfo();
if (info?.controller?.server) server = info?.controller?.server;
if (info?.controller?.secret) secret = info?.controller?.secret;
if (info?.server) server = info?.server;
if (info?.secret) secret = info?.secret;
} catch {}
axiosIns = axios.create({
@@ -29,7 +29,7 @@ export async function getAxios() {
export async function getInfomation() {
if (server) return { server, secret };
const info = await getClashInfo();
return info?.controller!;
return info!;
}
/// Get Version