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