You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.0 KiB
90 lines
3.0 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="./component/layui/css/layui.css" />
|
|
|
|
<style>
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
margin: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<script src="./component/layui/layui.js"></script>
|
|
|
|
|
|
<script>
|
|
layui.use(function () {
|
|
var layer = layui.layer;
|
|
var $ = layui.jquery;
|
|
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
dataType: "json",
|
|
async: false,
|
|
url: "/QingLong/maxkb/getApplication",
|
|
success: function (res) {
|
|
console.log(res);
|
|
if (res.success) {
|
|
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>';
|
|
$('body').append(iframe);
|
|
|
|
} else {
|
|
var loadIndex = layer.msg('AI助手初始化中...', {
|
|
icon: 16,
|
|
shade: 0.01
|
|
});
|
|
|
|
$.ajax({
|
|
url: '/QingLong/maxkb/createApplication',
|
|
type: 'post',
|
|
async: false,
|
|
success: function (result) {
|
|
if (result.success) {
|
|
layer.close(loadIndex);
|
|
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>';
|
|
$('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);
|
|
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |