以下是我们当前的配置。我们如何不通过storeConfig来配置,后端,身份验证,上下文?
B2cStorefrontModule.withConfig(environment.storeConfig), ConfigModule.withConfigFactory(defaultCmsContentConfig),
storeConfig: {
backend: {
occ: {
baseUrl: 'https://localhost:9002',
prefix: '/mywebservices/v2/'
}
},
authentication: {
client_id: 'myid',
client_secret: 'mysecret'
},
context: {
baseSite: ['mysite'],
currency: ['USD'],
},
i18n: {
resources: translations,
chunks: translationChunksConfig,
fallbackLang: 'en'
}
},
答案 0 :(得分:0)
您可以从provideConfig
导入@spartacus/core
并像这样使用它:
@NgModule({
...
imports: [
...
provideConfig({
// your config goes here
backend: {
occ: {
baseUrl: 'https://localhost:9002',
prefix: '/mywebservices/v2/'
}
},
authentication: {
client_id: 'myid',
client_secret: 'mysecret'
},
}),
]
...
})
您可以根据需要拥有任意数量的provideConfig()
。