nestjs关于HttpService的问题。

160 阅读1分钟

Please make sure that the argument HttpService at index [0] is available in the AdminModule context.

image.png

解决:,在用到HttpService的地方加入下图红框代码就可以了。 1、import { HttpModule } from '@nestjs/axios'; 2、HttpModule.register({ timeout: 5000, maxRedirects: 5, }), 3、 exports: [LoginService, HttpModule], image.png