From 1a543928b10428a15aad817adffe12bd5658d428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 26 Sep 2024 16:33:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/framework/napcat.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/framework/napcat.ts b/src/framework/napcat.ts index 8576876a..4cfbbdb1 100644 --- a/src/framework/napcat.ts +++ b/src/framework/napcat.ts @@ -9,6 +9,7 @@ import { NodeIKernelLoginService } from '@/core/services'; import { NodeIQQNTWrapperSession, WrapperNodeApi } from '@/core/wrapper'; import { InitWebUi, WebUiConfig } from '@/webui'; import { NapCatOneBot11Adapter } from '@/onebot'; +import { mkdir, mkdirSync } from 'fs'; //Framework ES入口文件 export async function getWebUiUrl() { @@ -26,8 +27,12 @@ export async function NCoreInitFramework( let dataPath: string | undefined; try { dataPath = (global as any).LiteLoader.plugins['NapCatQQ'].path.data; + if (dataPath) { + mkdirSync(dataPath, { recursive: true }); + } } catch (error) { dataPath = undefined; + } const pathWrapper = new NapCatPathWrapper(dataPath);