Jquery 在Fiori应用程序中加载SAPUI5图像,图像路径已更改

Jquery 在Fiori应用程序中加载SAPUI5图像,图像路径已更改,jquery,path,sapui5,sap-fiori,Jquery,Path,Sapui5,Sap Fiori,我正在尝试在我的fiori应用程序中加载图像。图像位于/webapp/img/greendot.jpg中,如下所示: 但随后我将应用程序部署到ABAP存储库,路径更改为: https://<server>:<port>/sap/bc/ui5_ui5/sap/my_application/~CD103454ACB782CF74F8A2339BE67CE1~5/img/greendot.png https://:/sap/bc/ui5\u ui5/sap/my\u appl

我正在尝试在我的fiori应用程序中加载图像。图像位于
/webapp/img/greendot.jpg
中,如下所示:

但随后我将应用程序部署到ABAP存储库,路径更改为:

https://<server>:<port>/sap/bc/ui5_ui5/sap/my_application/~CD103454ACB782CF74F8A2339BE67CE1~5/img/greendot.png
https://:/sap/bc/ui5\u ui5/sap/my\u application/~CD103454ACB782CF74F8A2339BE67CE1~5/img/greendot.png

如何获取此路径以便加载图像?

如果加载错误,应将SRC属性引用到相对路径:“/img/greendot.png”或尝试“/img/greendot.png”

在运行时不需要请求任何后端路径

var sRootPath=jQuery.sap.getModulePath(“”);
var sRootPath = jQuery.sap.getModulePath("<package_name>");
var sImagePath = sRootPath + "/img/greendot.png";
var sImagePath=sRootPath+“/img/greendot.png”;

似乎有效,但我不知道这是否是解决此问题的“正确”方法。

您的建议发送至:
https://:/sap/bc/ui5\u ui5/ui2/ushell/shell/abap/img/greendot.png
,还有其他想法吗?(我正在从Fiori启动板加载它,所以我只有Component.js)
var sRootPath = jQuery.sap.getModulePath("<package_name>");
var sImagePath = sRootPath + "/img/greendot.png";