问题描述
我正在尝试对环回 API 进行身份验证,但我收到模块 '"./datasources"' 没有导出成员 'DbDataSource'。
在我的 application.ts 中有
import {BootMixin} from '@loopback/boot';
import {RepositoryMixin} from '@loopback/repository';
import {RestApplication,OpenApiBuilder,ServerObject} from '@loopback/rest';
import {ServiceMixin} from '@loopback/service-proxy';
import {MySequence} from './sequence';
import {
AuthenticationBindings,UsersBindings,AssetsBindings,SubjectsBindings,CoursesBindings
} from './keys';
import {
AuthenticationService,UseRSService,AssetsService,CoursesService,SubjectsService
} from './services'
import {AuthenticationComponent} from '@loopback/authentication';
import {
JWTAuthenticationComponent,Security_SCHEME_SPEC,UserServiceBindings,} from '@loopback/authentication-jwt';
import {DbDataSource} from './datasources';
export class AtgCodeApplication extends BootMixin(
ServiceMixin(RepositoryMixin(RestApplication)),) {
private static instance: AtgCodeApplication;
constructor(options: ApplicationConfig = {}) {
super({
rest: {
cors: {}
}
});
我通过 DbDataSource 获得 Module '"./datasources"' has no exported member 'DbDataSource'.
并在 ApplicationConfig 中获得 Cannot find name 'ApplicationConfig'.
和 Parameter 'options' of constructor from exported class has or is using private name 'ApplicationConfig'.
我在 https://loopback.io/doc/en/lb4/Authentication-tutorial.html#step-1-bind-jwt-component-in-the-application 中使用 auth 程序作为公会。
我该如何修复这些错误。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)