mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
src
@@ -21,8 +21,7 @@ export class NapCatPathWrapper {
|
|||||||
this.logsPath = path.join(writePath, 'logs');
|
this.logsPath = path.join(writePath, 'logs');
|
||||||
this.configPath = path.join(writePath, 'config');
|
this.configPath = path.join(writePath, 'config');
|
||||||
this.cachePath = path.join(writePath, 'cache');
|
this.cachePath = path.join(writePath, 'cache');
|
||||||
//这个必然和本体一起
|
this.staticPath = path.join(this.binaryPath, 'static');
|
||||||
this.staticPath = path.join(dirname(fileURLToPath(import.meta.url)), 'static');
|
|
||||||
if (!fs.existsSync(this.logsPath)) {
|
if (!fs.existsSync(this.logsPath)) {
|
||||||
fs.mkdirSync(this.logsPath, { recursive: true });
|
fs.mkdirSync(this.logsPath, { recursive: true });
|
||||||
}
|
}
|
||||||
|
@@ -23,14 +23,7 @@ export async function NCoreInitFramework(
|
|||||||
) {
|
) {
|
||||||
//在进入本层前是否登录未进行判断
|
//在进入本层前是否登录未进行判断
|
||||||
console.log('NapCat Framework App Loading...');
|
console.log('NapCat Framework App Loading...');
|
||||||
let dataPath: string | undefined;
|
const pathWrapper = new NapCatPathWrapper();
|
||||||
try {
|
|
||||||
dataPath = (global as any).LiteLoader.plugins['NapCatQQ'].path.data;
|
|
||||||
} catch (error) {
|
|
||||||
dataPath = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pathWrapper = new NapCatPathWrapper(dataPath);
|
|
||||||
const logger = new LogWrapper(pathWrapper.logsPath);
|
const logger = new LogWrapper(pathWrapper.logsPath);
|
||||||
const basicInfoWrapper = new QQBasicInfoWrapper({ logger });
|
const basicInfoWrapper = new QQBasicInfoWrapper({ logger });
|
||||||
const wrapper = loadQQWrapper(basicInfoWrapper.getFullQQVesion());
|
const wrapper = loadQQWrapper(basicInfoWrapper.getFullQQVesion());
|
||||||
|
@@ -4,7 +4,7 @@ const { ipcRenderer } = require('electron');
|
|||||||
const napcat = {
|
const napcat = {
|
||||||
getWebUiUrl: async () => {
|
getWebUiUrl: async () => {
|
||||||
return ipcRenderer.invoke('napcat_get_webtoken');
|
return ipcRenderer.invoke('napcat_get_webtoken');
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
// 在window对象下导出只读对象
|
// 在window对象下导出只读对象
|
||||||
contextBridge.exposeInMainWorld('napcat', napcat);
|
contextBridge.exposeInMainWorld('napcat', napcat);
|
||||||
|
Reference in New Issue
Block a user