We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好:
import { Controller } from "./base"; //user.ts export default class User extends Controller { async user() { this.ctx.body = this.ctx.service.check.index(); // 这里仅仅爆 service 找不到,并不影响运行。 } async userInfo() { this.ctx.body = 'hello userinfo'; } }
我在 base.ts 临时加了 any,也没有找到好的方法
import { BaseContext } from "koa"; interface SelfBaseContext extends BaseContext { //继承接口 BaseContext service: any } export class Controller { ctx: SelfBaseContext; constructor(ctx: SelfBaseContext) { this.ctx = ctx; } }
The text was updated successfully, but these errors were encountered:
可以将 services 下面的模块引入来定义 service
Sorry, something went wrong.
No branches or pull requests
你好:
我在 base.ts 临时加了 any,也没有找到好的方法
The text was updated successfully, but these errors were encountered: