A MVC schema definition module has been added to eggjs. How can I mount Context?

problem description

1. App/modules,modules is built in mvc mode, and there are files corresponding to business logic in modeules, such as login, user management, rights management, role management. And so on, each file has a corresponding routing configuration, based on the implementation method of egg-router-plus.

2, for example, there are controllers folder, services folder and router configuration file in app/modules/users,users. Access to ctx.modules.users.services.index () is requested on controllers, but the result of accessing this ctx.modules is undefined.


Operation question:
eggjs how to mount this definition module on context and let the controllers in any module request access to services,services is ctx.modules.users.services.

Jun.23,2022

Sorry, this question cannot be answered

Menu