egg-lru
egg-lru copied to clipboard
类型“Application”上不存在属性“lru”。ts(2339)
import { provide, inject, Context } from '@ali/midway'
@provide('cacheService')
export class CacheService{
@inject()
ctx: Context;
get(key: string) {
return this.ctx.app.lru.get(key)
}
set(key: string, value) {
return this.ctx.app.lru.set(key, value)
}
}
编译时报错如下 error TS2339: Property 'lru' does not exist on type 'Application'.