如何使用SAP BAS在ui5应用中使用本地资源路径?

2020-08-16 13:07发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)你好! 我正在尝试从SAP B...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好!

我正在尝试从SAP Business Application Studio运行一个应用程序,从本地加载ui5引导程序src资源路径:

 <!DOCTYPE HTML>
 

 <头>
   
   
   


    fhirApp 

   
 

 
   

我已经在package.json中安装了依赖项:

 {
   " name":" fhirApp",
   " version":" 0.0.1",
   "脚本":{
     " start":" ui5服务--config = uimodule/ui5.yaml --open index.html",
     " build:ui":"运行-s build:uimodule",
     " test":" run-s lint karma",
     " karma-ci":"因果启动karma-ci.conf.js",
     " clearCoverage":" shx rm -rf coverage",
     " karma":" run-sclearCoverage karma-ci",
     " lint":" eslint",
     " build:mta":" mbt build",
     " deploy:cf":"跨变量cf部署mta_archives/fhirApp_ $ npm_package_version.mtar",
     " deploy":"运行构建:mta deploy:cf",
     " serve:uimodule":" ui5服务--config = uimodule/ui5.yaml",
     " build:uimodule":" ui5 build --config = uimodule/ui5.yaml --clean-dest --a --dest部署程序/资源/uimodule --include-task = generateManifestBundle"
   },
   " devDependencies":{
     " shx":" ^ 0.3.2",
     " @ ui5/cli":" ^ 2.2.5",
     " ui5-middleware-livereload":" ^ 0.3.0",
     "业力":" ^ 5.0.9",
     " karma-chrome-launcher":" ^ 3.1.0",
     "业力覆盖":" ^ 2.0.2",
     " karma-ui5":" ^ 2.1.2",
     " npm-run-all":" ^ 4.1.5",
     " eslint":" ^ 7.1.0",
     " ui5-middleware-cfdestination":" ^ 0.2.0",
     " ui5-task-zipper":" ^ 0.3.0",
     " cross-var":" ^ 1.1.0",
     " mbt":" ^ 1.0.14"
   },
   " ui5":{
     "依赖关系":[
       " openui5-fhir",
       " ui5-middleware-livereload",
       " ui5-middleware-cfdestination",
       " ui5-任务拉链"
     ]
   },
   "依赖关系":{
     " openui5-fhir":" ^ 1.0.5",
     " @ openui5/sap.m":" ^ 1.75.0",
     " @ openui5/sap.ui.core":" ^ 1.75.0",
     " @ openui5/themelib_sap_fiori_3":" ^ 1.75.0",
     " @ openui5/sap.uxap":" ^ 1.75.0"
   }
 } 

而且我在xs-app.json文件中引用了我的webapp文件夹:

 {
   " welcomeFile":" samplecloudfhirApp/index.html",
   " authenticationMethod":"无",
   "登出": {
     " logoutEndpoint":"/img/do/logout"
   },
   "路线":[
     {
       " source":" ^/samplecloudfhirApp/(.*)$",
       " target":" $ 1",
       " localDir":" ../uimodule/webapp",
       " authenticationType":" xsuaa"
     },
     {
       " source":" ^/myDest/(.*)$",
       " target":" $ 1",
       " authenticationType":"无",
       "目标":" myDest"
     }
   ]
 }
 

但是当我运行该应用程序时,出现以下错误:

对/resources/sap-ui-core.js的GET请求已完成,状态为404-ENOENT:无此类文件或目录,stat'/home/user/projects/sample.cloud.fhirApp/uimodule/webapp/resources/ sap-ui-core.js'#

如果我将资源链接到远程库( https://sapui5.hana.ondemand.com/resources/sap-ui-core.js )可以正常工作,但是我不能使用package.json中引用的其他库(例如openui5-fhir)。/p>

在VS Code中,该应用程序可以与本地资源路径一起正常工作。.但是我试图使用approuter在SAP BAS中直接进行开发。.

您能帮我吗?

提前谢谢!