mirror of
https://github.com/cool-team-official/cool-admin-midway-packages.git
synced 2025-12-11 13:52:50 +00:00
新增缓存支持
This commit is contained in:
parent
3ee0695785
commit
af0ee28433
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-midway/plugin-cli",
|
||||
"version": "7.1.3",
|
||||
"version": "7.1.4",
|
||||
"description": "cool-admin midway plugin",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
@ -22,7 +22,8 @@
|
||||
"readme": "README.md",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@midwayjs/core": "^3.14.0",
|
||||
"@midwayjs/cache-manager": "^3.15.2",
|
||||
"@midwayjs/core": "^3.15.0",
|
||||
"archiver": "^6.0.1",
|
||||
"esbuild": "^0.19.11",
|
||||
"esbuild-plugin-copy": "^2.1.1"
|
||||
@ -30,4 +31,4 @@
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { MidwayCache } from "@midwayjs/cache-manager";
|
||||
import { IMidwayContext, IMidwayApplication } from "@midwayjs/core";
|
||||
|
||||
// 文件上传
|
||||
@ -46,6 +47,8 @@ export abstract class BasePlugin {
|
||||
ctx: IMidwayContext;
|
||||
/** 应用实例,用到此项无法本地调试,需安装到cool-admin中才能调试 */
|
||||
app: IMidwayApplication;
|
||||
/** 缓存 */
|
||||
cache: MidwayCache;
|
||||
|
||||
setCtx(ctx: IMidwayContext) {
|
||||
this.ctx = ctx;
|
||||
@ -66,10 +69,14 @@ export abstract class BasePlugin {
|
||||
async init(
|
||||
pluginInfo: PluginInfo,
|
||||
ctx?: IMidwayContext,
|
||||
app?: IMidwayApplication
|
||||
app?: IMidwayApplication,
|
||||
other?: any
|
||||
) {
|
||||
this.pluginInfo = pluginInfo;
|
||||
this.ctx = ctx;
|
||||
this.app = app;
|
||||
if (other) {
|
||||
this.cache = other.cache;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user