的index.html
`<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge chrome=1">
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="manifest" href="manifest.json">
<script src="site.js"></script>
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="aliceblue">
<link rel="icon" sizes="192x192" href="images/logo/logo_192x192.png">
<meta name="application-name" content="OBDX">
<meta name="apple-mobile-web-app-title" content="" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="images/logo/logo_152x152.png">
<meta name="msapplication-TileImage" content="images/logo/logo_144x144.png">
</head>
<body>
<div class="se-pre-con"></div>
<script src="/framework/js/libs/oraclejet/js/libs/require/require.js"></script>/framework/js/pages/require-config.js
<script>
require(['/framework/js/pages/require-config.js'], function () {
require([
'jquery',
'baseService'
], function ($, BaseService) {
'use strict';
$(document).ready(function () {
var baseService = BaseService.getInstance();
var urlToRedirect = '';
var options = {
url: 'me',
success: function (data) {
var array = data.userProfile.roles;
var partyId, partyIdDisplayValue, firstName;
if (data.userProfile) {
firstName = data.userProfile.firstName;
}
if (data.userProfile.partyId) {
partyId = data.userProfile.partyId.value;
partyIdDisplayValue = data.userProfile.partyId.displayValue;
}
if ($.inArray("RetailUser", array) > -1) {
urlToRedirect += '/retail/pages/';
} else if (($.inArray("CorporateUser", array) > -1) && (($.inArray("CorporateAdminChecker", array) > -1) || ($.inArray("CorporateAdminMaker", array) > -1))) {
if (partyId) {
sessionStorage.setItem('partyId', partyId);
sessionStorage.setItem('roles', array);
sessionStorage.setItem('partyIdDisplayValue', partyIdDisplayValue);
sessionStorage.setItem('firstName', firstName);
}
urlToRedirect += '/corporate-admin/pages/';
}
else if ($.inArray("CorporateUser", array) > -1) {
urlToRedirect += '/corporate/pages/';
} else if ($.inArray("Administrator", array) > -1) {
if (partyId) {
sessionStorage.setItem('partyId', partyId);
sessionStorage.setItem('roles', array);
sessionStorage.setItem('partyIdDisplayValue', partyIdDisplayValue);
sessionStorage.setItem('firstName', firstName);
}
urlToRedirect += '/admin/pages/';
}
if ($.inArray("Viewer", array) > -1) {
urlToRedirect += 'viewer.html';
} else if ($.inArray("Checker", array) > -1) {
urlToRedirect += 'approver.html';
} else if ($.inArray("Maker", array) > -1) {
urlToRedirect += 'maker.html';
} else {
urlToRedirect += 'dashboard.html';
}
if (urlToRedirect) {
window.location.href = urlToRedirect;
}
}
};
baseService.fetch(options);
});
});
});
</script>
</body>
</html>`
sw.js
我的团队目前部署了使用oracle jet构建的解决方案,我们正在努力使其成为一个渐进的Web应用程序。我们已经编写了我们的服务工作者并按照谷歌代码中的建议编辑了manifest.json和index.html页面,但服务工作者没有注册。
任何有经验的人,请帮忙