Cloud for Customer的主页加载逻辑
先看源代碼:
<!DOCTYPE HTML> <html> <head><title></title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--If you change the scaling here, dont forget to change it at sap.client.controls.core.Application.prototype._adjustViewPort as well--><meta name="viewport" content="width=device-width, minimum-scale=1.25, maximum-scale=1.25"/><script src="resources/sap-ui-cachebuster/sap-ui-core.js" type="text/javascript"id="sap-ui-bootstrap"data-sap-ui-libs="sap.ui.layout, sap.ui.commons"data-sap-ui-preload="async"data-sap-ui-xx-bindingSyntax="complex"data-sap-ui-theme="skyline" ></script><script type="text/javascript" id="sap-client-application"data-sap-client-gitCommitId="ef2e7f1c05c452bf6236641fc226cea497b68e0e"data-sap-client-mavenArtifactVersion="SNAPSHOT version" data-sap-client-buildTimestamp="254" data-sap-byd-debugMode="false"data-sap-client-language="en"data-sap-client-application-name="SAP Business ByDesign"src="resources/sap/client/ApplicationStarter.js"></script><script>jQuery.sap.require("sap.client.thirdparty.jqueryui.jquery-ui-min");</script><style type="text/css">html, body {height: 100%;margin: 0;padding: 0;}</style><!-- make myself the window owner for 1308!--><style type="text/css"> html{display : none ; } </style><script type="text/javascript">if (self == top) {document.documentElement.style.display = 'block';} else {top.location = self.location;}</script></head> <body class="sapUiBody" role="application"> <div id="content" style="height: 100%"></div> </body> </html>這個index.html加載的請求url:
https://sap/public/ap/ui/repository/SAP_UI/HTML5/client.html?app.component=/SAP_UI_CT/Main/root.uiccwoc&rootWindow=X&redirectUrl=/sap/public/byd/runtime
因為Cloud for Customer的UI也是基于UI5框架實現的,故接下來需要加載sap-ui-core.js:
https://sap/public/ap/ui/repository/SAP_UI/HTML5/resources/sap-ui-cachebuster/sap-ui-core.js
使用document.write動態加載新的jscript標簽:
下面這段代碼是SAP UI5里對調試版本的JavaScript文件的加載實現:
client.html?app…i/byd/runtime UIArea-dbg.js?eva sap-ui-core.js sap-ui-core.js:formatted jquery.sap.global-dbgjs × |>window [“sap-ui-debug”] = vDebugInfo =vDebugInfo I1 true;
56957057357257574575570575755798058158583
if (window[“sap-ui-optimized”] && vDebugInfo ) {// if current sources are optimized and any debug sources should be used, enable the “-dbg” suffixindow [“sap-ui-loaddbg”] = true;11 if debug sources should be used in general, restart with debug URif (vDebuginfo === true ) {var sDebugurl =_oBootstrap.url.replace(八/(?:sap-ui-cachebuster/)? ([^/]+).js/, “/$1-dbg.js”);window [“sap-ui-optimized”] = falseHocument.write("<script type=“text/javascript” src="" + sDebugurl + “”");var oRestart =new Error ("This is not a real error. Aborting UI5 bootstrap and restarting from: " + sDebugurl);oRestart.name = “Restart”:throw oRestart;
WorkCenter
WorkCenterModel
ComponentModel
sap/client/nav
then a http post: https://sap/ap/ui/json
然后是一個HTTP post請求:
{"fuba":{"name":"00163E01065F02DE83D0F2780D8BC056","imports":{"IV_CACHE_KEY":"E$BC135D2FF914825F2728E7B636C5828F3DDD078C$X","IV_WOC_SEQ":true,"IV_INCLUDE_CC":true,"IV_INCLUDE_INV":false,"IV_WITH_COMMON_TASKS":"X"}}}https://sap/ap/ui/json?app.component=/SAP_UI_CT/Main/root.uiccwoc&h=47078d04baa8890e992100506a0f3276&g=b0181c02b0aec5337da81f77b15fbb85
FM_MASS_CHECK_RAW_CACHE_KEY
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的Cloud for Customer的主页加载逻辑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Cloud for Customer的工
- 下一篇: Marketing Cloud和Clou