优化菜单导入

This commit is contained in:
cool 2024-04-24 09:11:44 +08:00
parent 8deaa90fd4
commit d117b84dd1
3 changed files with 71 additions and 62 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@cool-midway/core",
"version": "7.1.17",
"version": "7.1.18",
"description": "",
"main": "dist/index.js",
"typings": "index.d.ts",

View File

@ -1,4 +1,14 @@
import { App, Config, ILogger, IMidwayApplication, Inject, Logger, Provide, Scope, ScopeEnum } from "@midwayjs/core";
import {
App,
Config,
ILogger,
IMidwayApplication,
Inject,
Logger,
Provide,
Scope,
ScopeEnum,
} from "@midwayjs/core";
import * as fs from "fs";
import { CoolModuleConfig } from "./config";
import * as path from "path";
@ -11,7 +21,6 @@ import { CoolEventManager } from "../event";
@Provide()
@Scope(ScopeEnum.Singleton)
export class CoolModuleMenu {
@Inject()
coolModuleConfig: CoolModuleConfig;
@ -37,7 +46,7 @@ export class CoolModuleMenu {
`${this.app.getBaseDir()}`,
"..",
"lock",
'menu'
"menu"
);
if (!fs.existsSync(importLockPath)) {
fs.mkdirSync(importLockPath, { recursive: true });
@ -49,7 +58,7 @@ export class CoolModuleMenu {
}
}
this.coolEventManager.emit("onMenuImport", this.datas);
this.coolEventManager.emit("onMenuInit", {});
// this.coolEventManager.emit("onMenuInit", {});
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@cool-midway/core",
"version": "7.1.17",
"version": "7.1.18",
"description": "",
"main": "index.js",
"typings": "index.d.ts",