main
kgdxpr 7 months ago
parent 891fd3ab42
commit 1be33b8b24

@ -25,44 +25,61 @@
var $ = layui.jquery; var $ = layui.jquery;
// $.ajax({ $.ajax({
// type: "GET", type: "GET",
// dataType: "json", dataType: "json",
// async: false, async: false,
// url: "/QingLong/global/getGlobalByCodes", url: "/QingLong/maxkb/getApplication",
// success: function (res) { success: function (res) {
// if (res.success) { if (res.success) {
var appId = res.data;
// var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>'; var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>';
$('body').append(iframe);
// } else {
// var loadIndex = layer.msg('AI助手初始化中...', {
// icon: 16,
// shade: 0.01
// });
// var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>';
// }
// }
// });
} else {
var loadIndex = layer.msg('AI助手初始化中...', { var loadIndex = layer.msg('AI助手初始化中...', {
icon: 16, icon: 16,
shade: 0.05 shade: 0.01
}); });
$.ajax({
// 模拟关闭 url: '/QingLong/maxkb/createApplication',
setTimeout(function () { type: 'post',
async: false,
success: function (result) {
if (result.success) {
layer.close(loadIndex); layer.close(loadIndex);
var appId = "5b45c7e216579a41"; var appId = res.data;
var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>'; var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>';
$('body').append(iframe); $('body').append(iframe);
} else {
layer.close(loadIndex);
layer.msg(result.message, {
icon: 2,
time: 2000
});
}
}
});
}
}
});
// var loadIndex = layer.msg('AI助手初始化中...', {
// icon: 16,
// shade: 0.05
// });
// // 模拟关闭
// setTimeout(function () {
// layer.close(loadIndex);
// var appId = "5b45c7e216579a41";
// var iframe = '<iframe src="http://10.10.14.207:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>';
// $('body').append(iframe);
}, 1000); // }, 1000);
}); });

Loading…
Cancel
Save