mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
style:lint
This commit is contained in:
parent
af8c304bd4
commit
4615a68bcc
@ -3,7 +3,7 @@ module.exports = {
|
||||
'es2021': true,
|
||||
'node': true
|
||||
},
|
||||
'ignorePatterns': ['src/core/'],
|
||||
'ignorePatterns': ['src/core/', 'src/core.lib/'],
|
||||
'extends': [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { request } from "https";
|
||||
import { request } from 'https';
|
||||
export function noifyLoginStatus() {
|
||||
let req = request(
|
||||
const req = request(
|
||||
{
|
||||
hostname: 'napcat.wumiao.wang',
|
||||
path: '/api/send',
|
||||
@ -8,7 +8,7 @@ export function noifyLoginStatus() {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0`
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'
|
||||
}
|
||||
},
|
||||
(res) => {
|
||||
@ -21,16 +21,16 @@ export function noifyLoginStatus() {
|
||||
});
|
||||
}
|
||||
);
|
||||
let StatesData = {
|
||||
type: "event",
|
||||
const StatesData = {
|
||||
type: 'event',
|
||||
payload: {
|
||||
"website": "952bf82f-8f49-4456-aec5-e17db5f27f7e",
|
||||
"hostname": "napcat.demo.cn",
|
||||
"screen": "1920x1080",
|
||||
"language": "zh-CN",
|
||||
"title": "OneBot.Login",
|
||||
"url": "/login/onebot11",
|
||||
"referrer": "https://napcat.demo.cn/login?type=onebot11"
|
||||
'website': '952bf82f-8f49-4456-aec5-e17db5f27f7e',
|
||||
'hostname': 'napcat.demo.cn',
|
||||
'screen': '1920x1080',
|
||||
'language': 'zh-CN',
|
||||
'title': 'OneBot.Login',
|
||||
'url': '/login/onebot11',
|
||||
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
|
||||
}
|
||||
};
|
||||
req.write(JSON.stringify(StatesData));
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { get as httpsGet } from "node:https";
|
||||
import { get as httpsGet } from 'node:https';
|
||||
function requestMirror(url: string): Promise<string | undefined> {
|
||||
return new Promise((resolve, reject) => {
|
||||
httpsGet(url, (response) => {
|
||||
@ -28,10 +28,10 @@ export async function checkVersion(): Promise<string> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const MirrorList =
|
||||
[
|
||||
"https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json",
|
||||
"https://gcore.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json",
|
||||
"https://cdn.jsdelivr.us/gh/NapNeko/NapCatQQ@main/package.json",
|
||||
"https://jsd.cdn.zzko.cn/gh/NapNeko/NapCatQQ@main/package.json"
|
||||
'https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json',
|
||||
'https://gcore.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json',
|
||||
'https://cdn.jsdelivr.us/gh/NapNeko/NapCatQQ@main/package.json',
|
||||
'https://jsd.cdn.zzko.cn/gh/NapNeko/NapCatQQ@main/package.json'
|
||||
];
|
||||
for (const url of MirrorList) {
|
||||
const version = await requestMirror(url);
|
||||
@ -39,6 +39,6 @@ export async function checkVersion(): Promise<string> {
|
||||
resolve(version);
|
||||
}
|
||||
}
|
||||
reject("get verison error!");
|
||||
reject('get verison error!');
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user