和培训老师讲得一样,经过了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 static
- configuration (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可见,pagecontext的id和type,出现在了HTTP请求的parameters里。
网友评论