app.js 284 B

123456789101112131415
  1. 'use strict';
  2. class AppBootHook {
  3. constructor(app) {
  4. this.app = app;
  5. }
  6. // 应用已启动阶段
  7. async didReady() {
  8. // 初始化数据
  9. const ctx = await this.app.createAnonymousContext();
  10. await ctx.service.install.index();
  11. }
  12. }
  13. module.exports = AppBootHook;