和培训老师讲得一样,经过了connector->adapter->service的过程:
Returns an observable with the page structure. The page structure is
typically loaded from a backend, but can also be returned from staticconfiguration (see CmsStructureConfigService). // load page by PageContext const httpParams = this.getPagesRequestParams(pageContext); return this.http .get(this.getPagesEndpoint(httpParams, fields), { headers: this.headers, }) .pipe(this.converter.pipeable(CMS_PAGE_NORMALIZER)); }页面pagecontext由id和type组成:
这个page context作为http请求的参数:
如果没有指定请求的fields,则使用默认的DEFAULT:
/** * Returns a fully qualified OCC Url (including baseUrl and baseSite) * @param endpoint Name of the OCC endpoint key config * @param urlParams URL parameters * @param queryParams Query parameters * @param scope */ getUrl( endpoint: string, urlParams?: object, queryParams?: object, scope?: string ): string这里取得endpointconfig:
OccEndpointsService._activeBaseSite从哪里来的?
url:https://jerry.eastus.cloudapp.azure.com:9002/occ/v211/electronics-spa/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=homepage
从url可见,pagecontext的id和type,出现在了HTTP请求的parameters里。
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
汪子熙 认证博客专家 前端框架 Node.js SAP JerryWang,2007年从电子科技大学计算机专业硕士毕业后加入SAP成都研究院工作至今。Jerry是SAP社区导师,SAP中国技术大使。2020年5月下旬,Jerry做了脑部肿瘤的开颅切除手术,对编程和人生又有了新的感悟。