mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: check version catch
This commit is contained in:
parent
22f74be4cd
commit
cc211706d5
@ -16,7 +16,7 @@ import {
|
||||
GrayTipElementSubType,
|
||||
Group,
|
||||
GroupMember,
|
||||
IMAGE_HTTP_HOST,
|
||||
IMAGE_HTTP_HOST, IMAGE_HTTP_HOST_NT,
|
||||
RawMessage,
|
||||
SelfInfo,
|
||||
Sex,
|
||||
@ -160,7 +160,11 @@ export class OB11Constructor {
|
||||
message_data['data']['url'] = IMAGE_HTTP_HOST + url;
|
||||
} else {
|
||||
// 有可能会碰到appid为1406的,这个不能使用新的NT域名,并且需要把appid改为1407才可访问
|
||||
message_data['data']['url'] = `${IMAGE_HTTP_HOST}/download?appid=1407&fileid=${fileUuid}&rkey=${currentRKey}&spec=0`;
|
||||
let host = IMAGE_HTTP_HOST_NT;
|
||||
if (url.includes('appid=1406')) {
|
||||
host = IMAGE_HTTP_HOST;
|
||||
}
|
||||
message_data['data']['url'] = `${host}/download?appid=1407&fileid=${fileUuid}&rkey=${currentRKey}&spec=0`;
|
||||
}
|
||||
} else {
|
||||
message_data['data']['url'] = IMAGE_HTTP_HOST + url;
|
||||
|
@ -21,17 +21,19 @@ checkVersion().then((remoteVersion: string) => {
|
||||
const localVersion = require('./package.json').version;
|
||||
const localVersionList = localVersion.split('.');
|
||||
const remoteVersionList = remoteVersion.split('.');
|
||||
console.log('[NapCat] [Upate] 当前版本:', localVersion);
|
||||
console.log('[NapCat] 当前版本:', localVersion);
|
||||
for (const k of [0, 1, 2]) {
|
||||
if (parseInt(remoteVersionList[k]) > parseInt(localVersionList[k])) {
|
||||
console.log('[NapCat] [Upate] 检测到更新,请前往 https://github.com/NapNeko/NapCatQQ 下载 NapCatQQ V', remoteVersion);
|
||||
console.log('[NapCat] 检测到更新,请前往 https://github.com/NapNeko/NapCatQQ 下载 NapCatQQ V', remoteVersion);
|
||||
return;
|
||||
} else if (parseInt(remoteVersionList[k]) < parseInt(localVersionList[k])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log('[NapCat] [Upate] 当前已是最新版本');
|
||||
console.log('[NapCat] 当前已是最新版本');
|
||||
return;
|
||||
}).catch((e) => {
|
||||
console.error('[NapCat] 检测更新失败');
|
||||
});
|
||||
new NapCatOnebot11();
|
||||
napCatCore.addLoginSuccessCallback(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user