mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
opt
This commit is contained in:
parent
4678253815
commit
1472c9c949
@ -1,5 +1,4 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import fs from 'node:fs'
|
|
||||||
import os from 'node:os'
|
import os from 'node:os'
|
||||||
import { systemPlatform } from './system'
|
import { systemPlatform } from './system'
|
||||||
|
|
||||||
@ -38,32 +37,6 @@ type QQPkgInfo = {
|
|||||||
platform: string
|
platform: string
|
||||||
eleArch: string
|
eleArch: string
|
||||||
}
|
}
|
||||||
type QQVersionConfigInfo = {
|
|
||||||
baseVersion: string
|
|
||||||
curVersion: string
|
|
||||||
prevVersion: string
|
|
||||||
onErrorVersions: Array<any>
|
|
||||||
buildId: string
|
|
||||||
}
|
|
||||||
|
|
||||||
let _qqVersionConfigInfo: QQVersionConfigInfo = {
|
|
||||||
'baseVersion': '9.9.9-23361',
|
|
||||||
'curVersion': '9.9.9-23361',
|
|
||||||
'prevVersion': '',
|
|
||||||
'onErrorVersions': [],
|
|
||||||
'buildId': '23361',
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fs.existsSync(configVersionInfoPath)) {
|
|
||||||
try {
|
|
||||||
const _ = JSON.parse(fs.readFileSync(configVersionInfoPath).toString())
|
|
||||||
_qqVersionConfigInfo = Object.assign(_qqVersionConfigInfo, _)
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Load QQ version config info failed, Use default version', e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo
|
|
||||||
|
|
||||||
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath)
|
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath)
|
||||||
// platform_type: 3,
|
// platform_type: 3,
|
||||||
@ -74,14 +47,6 @@ export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath)
|
|||||||
// platVer: '10.0.26100',
|
// platVer: '10.0.26100',
|
||||||
// clientVer: '9.9.9-23159',
|
// clientVer: '9.9.9-23159',
|
||||||
|
|
||||||
let _appid: string = '537213803' // 默认为 Windows 平台的 appid
|
|
||||||
if (systemPlatform === 'linux') {
|
|
||||||
_appid = '537213827'
|
|
||||||
}
|
|
||||||
// todo: mac 平台的 appid
|
|
||||||
export const appid = _appid
|
|
||||||
export const isQQ998: boolean = qqPkgInfo.buildVersion >= '22106'
|
|
||||||
|
|
||||||
export function getBuildVersion(): number {
|
export function getBuildVersion(): number {
|
||||||
return +qqPkgInfo.buildVersion
|
return +qqPkgInfo.buildVersion
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user