main
kgdxpr 7 months ago
parent 48d4215600
commit 05d04ef32c

@ -22,7 +22,7 @@
<script> <script>
layui.use(function () { layui.use(function () {
var layer = layui.layer; var layer = layui.layer;
var $ = layui.jquery; var $ = layui.jquery;
$.ajax({ $.ajax({
@ -34,9 +34,8 @@
console.log(res); console.log(res);
if (res.success) { if (res.success) {
var appId = res.data; var appId = res.data;
var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>'; var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>';
$('body').append(iframe); $('body').append(iframe);
} else { } else {
var loadIndex = layer.msg('AI助手初始化中...', { var loadIndex = layer.msg('AI助手初始化中...', {
icon: 16, icon: 16,
@ -47,22 +46,35 @@
url: '/QingLong/maxkb/createApplication', url: '/QingLong/maxkb/createApplication',
type: 'post', type: 'post',
async: false, async: false,
success: function (result) { success: function (res) {
if (result.success) { console.log(res);
layer.close(loadIndex); if (res.success) {
var appId = res.data; var appId = res.data;
var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 100%;" frameborder="0" allow="microphone"></iframe>'; var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>';
$('body').append(iframe); $('body').append(iframe);
} else { } else {
layer.close(loadIndex); layer.msg(res.message, {
layer.msg(result.message, {
icon: 2, icon: 2,
time: 2000 time: 2000
}); });
} }
layer.close(loadIndex);
},
error: function (xhr, status, error) {
layer.close(loadIndex);
layer.msg("AI助手异常请稍后再试", {
icon: 2,
time: 2000
});
} }
}); });
} }
},
error: function (xhr, status, error) {
layer.msg("AI助手异常请稍后再试", {
icon: 2,
time: 2000
});
} }
}); });
@ -71,14 +83,12 @@
// icon: 16, // icon: 16,
// shade: 0.05 // shade: 0.05
// }); // });
// // 模拟关闭 // // 模拟关闭
// setTimeout(function () { // setTimeout(function () {
// layer.close(loadIndex); // layer.close(loadIndex);
// var appId = "5b45c7e216579a41"; // 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>'; // 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); // $('body').append(format(iframeUrl, appId));
// }, 1000); // }, 1000);

Loading…
Cancel
Save