您的位置:首页 > 其它

Cloud for Customer的主页加载逻辑

2019-04-22 16:53 651 查看
版权声明:本文为博主汪子熙原创文章,未经博主允许不得转载。 https://blog.csdn.net/i042416/article/details/89455677

先看源代码:

<!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的原创文章,请关注公众号"汪子熙":

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: