mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: 破坏性更新 cjs to es
This commit is contained in:
@@ -5,6 +5,13 @@ import { resolve } from 'node:path';
|
||||
import { ALLRouter } from './src/router';
|
||||
import { WebUiConfig } from './src/helper/config';
|
||||
const app = express();
|
||||
import { dirname } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
/**
|
||||
* 初始化并启动WebUI服务。
|
||||
* 该函数配置了Express服务器以支持JSON解析和静态文件服务,并监听6099端口。
|
||||
|
||||
@@ -2,6 +2,12 @@ import { RequestHandler } from "express";
|
||||
import { resolve } from "path";
|
||||
import { readdir, stat } from "fs/promises";
|
||||
import { existsSync } from "fs";
|
||||
import { dirname } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
export const GetLogFileListHandler: RequestHandler = async (req, res) => {
|
||||
try {
|
||||
let LogsPath = resolve(__dirname, "./logs/");
|
||||
|
||||
@@ -3,6 +3,13 @@ import { WebUiDataRuntime } from "../helper/Data";
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { OB11Config } from "@/webui/ui/components/WebUiApiOB11Config";
|
||||
import { dirname } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const isEmpty = (data: any) =>
|
||||
data === undefined || data === null || data === "";
|
||||
export const OB11GetConfigHandler: RequestHandler = async (req, res) => {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
const net = require('net');
|
||||
import * as net from "node:net";
|
||||
import { dirname } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// 限制尝试端口的次数,避免死循环
|
||||
const MAX_PORT_TRY = 100;
|
||||
|
||||
Reference in New Issue
Block a user