From ba429f92e63f98e079e69f0eabe00761222a296b Mon Sep 17 00:00:00 2001 From: originalFactor <2438926613@qq.com> Date: Sat, 14 Feb 2026 09:52:37 +0800 Subject: [PATCH] avoid using any --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 424c0bc..43bc125 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,14 +4,14 @@ import path from 'path' // pkg 打包后,需要从可执行文件所在目录读取 .env 文件 // @ts-ignore - process.pkg 是 pkg 打包后添加的属性 -const envPath = (process as any).pkg +const envPath = process.pkg ? path.join(path.dirname(process.execPath), '.env') : path.join(process.cwd(), '.env') dotenv.config({ path: envPath }) import express from 'express' -import { createServer } from 'http' +import { Server, createServer } from 'http' import { Server as SocketIOServer } from 'socket.io' import cors from 'cors' import multer from 'multer' @@ -32,7 +32,7 @@ import { AdaptiveQualityService } from './services/AdaptiveQualityService' */ class RemoteControlServer { private app: express.Application - private server: any + private server: Server private io: SocketIOServer private deviceManager: DeviceManager private webClientManager: WebClientManager