style:lint

This commit is contained in:
手瓜一十雪
2024-08-06 11:12:25 +08:00
parent a6dec70e4e
commit 607f63b40b
13 changed files with 72 additions and 64 deletions

View File

@@ -6,15 +6,15 @@ import AppidTable from '@/core/external/appid.json';
import { log } from './log';
//基础目录获取
export let QQMainPath = process.execPath;
export let QQPackageInfoPath: string = path.join(path.dirname(QQMainPath), 'resources', 'app', 'package.json');
export let QQVersionConfigPath: string | undefined = getQQVersionConfigPath(QQMainPath);
export const QQMainPath = process.execPath;
export const QQPackageInfoPath: string = path.join(path.dirname(QQMainPath), 'resources', 'app', 'package.json');
export const QQVersionConfigPath: string | undefined = getQQVersionConfigPath(QQMainPath);
//基础信息获取 无快更则启用默认模板填充
export let isQuickUpdate: boolean = !!QQVersionConfigPath;
export let QQVersionConfig: QQVersionConfigType = isQuickUpdate ? JSON.parse(fs.readFileSync(QQVersionConfigPath!).toString()) : getDefaultQQVersionConfigInfo();
export let QQPackageInfo: QQPackageInfoType = JSON.parse(fs.readFileSync(QQPackageInfoPath).toString());
export let { appid: QQVersionAppid, qua: QQVersionQua } = getAppidV2();
export const isQuickUpdate: boolean = !!QQVersionConfigPath;
export const QQVersionConfig: QQVersionConfigType = isQuickUpdate ? JSON.parse(fs.readFileSync(QQVersionConfigPath!).toString()) : getDefaultQQVersionConfigInfo();
export const QQPackageInfo: QQPackageInfoType = JSON.parse(fs.readFileSync(QQPackageInfoPath).toString());
export const { appid: QQVersionAppid, qua: QQVersionQua } = getAppidV2();
//基础函数
export function getQQBuildStr() {
@@ -31,9 +31,9 @@ export function getQUAInternal() {
return systemPlatform === 'linux' ? `V1_LNX_NQ_${getFullQQVesion()}_${getQQBuildStr()}_GW_B` : `V1_WIN_NQ_${getFullQQVesion()}_${getQQBuildStr()}_GW_B`;
}
export function getAppidV2(): { appid: string, qua: string } {
let appidTbale = AppidTable as unknown as QQAppidTableType;
const appidTbale = AppidTable as unknown as QQAppidTableType;
try {
let data = appidTbale[getFullQQVesion()];
const data = appidTbale[getFullQQVesion()];
if (data) {
return data;
}

View File

@@ -195,7 +195,7 @@ export async function uri2local(UriOrPath: string, fileName: string | null = nul
let url = null;
//区分path和uri
try {
if (fs.existsSync(UriOrPath)) url = new URL("file://" + UriOrPath);
if (fs.existsSync(UriOrPath)) url = new URL('file://' + UriOrPath);
} catch (error: any) { }
try {
url = new URL(UriOrPath);

View File

@@ -360,12 +360,12 @@ export async function promisePipeline(promises: Promise<any>[], callback: (resul
callbackCalled = callback(result);
}
} catch (error) {
console.error("Error in promise pipeline:", error);
console.error('Error in promise pipeline:', error);
}
}
}
export function getQQVersionConfigPath(exePath: string = ""): string | undefined {
export function getQQVersionConfigPath(exePath: string = ''): string | undefined {
let configVersionInfoPath;
if (os.platform() !== 'linux') {
configVersionInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'versions', 'config.json');