我们已经使用Recast.AI为本地ERP开发了chatbot功能。
基本上,我们已使用以下代码在本地Fiori启动板上部署了一个插件;但是,聊天机器人启动后,Fiori启动板会冻结,我们无法在Fiori Launchpad上执行任何操作。 SAP Note 2544600中的选项对我们没有帮助。任何想法,可能是什么问题?
此致
Karan
sap.ui.define([
"sap/ui/core/UIComponent",
], function (UIComponent) {
"use strict";
return UIComponent.extend("com.abc.chatbot.Component", {
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
init: function () {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
var renderer = sap.ushell.Container.getRenderer("fiori2");
if (!document.getElementById("recast-webchat")) {
var s = document.createElement("script");
s.setAttribute("id", "recast-webchat");
s.setAttribute("src", "https://cdn.recast.ai/webchat/webchat.js");
//document.body.appendChild(s);
if (document.body != null) {
document.body.appendChild(s);
}
}
s.setAttribute("channelId", "abc");
s.setAttribute("token", "xyz");
}
});
});
问题出在appendChild;这会使启动板无响应。由于我尝试了多种方法(例如创建div,片段),因此不确定是否可以替代。
答案 0 :(得分:0)
此网聊已针对Fiori进行了更新。现在应该可以了