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.

84 lines
3.0 KiB

7 months ago
<!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;
7 months ago
var $ = layui.jquery;
7 months ago
7 months ago
$.ajax({
type: "GET",
dataType: "json",
async: false,
url: "/QingLong/maxkb/getApplication",
7 months ago
success: function (res) {
7 months ago
if (res.success) {
7 months ago
var appId = res.access_token;
7 months ago
var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>';
7 months ago
$('body').append(iframe);
} else {
7 months ago
layer.msg('AI助手初始化中...', {
7 months ago
icon: 16,
shade: 0.01
});
$.ajax({
url: '/QingLong/maxkb/createApplication',
type: 'post',
7 months ago
async: true,
success: function (res) {
7 months ago
if (res.success) {
7 months ago
var appId = res.access_token;
7 months ago
var iframe = '<iframe src="http://10.10.14.206:8080/ui/chat/' + appId + '" style="width: 100%; height: 99.5%;" frameborder="0" allow="microphone"></iframe>';
7 months ago
$('body').append(iframe);
7 months ago
} else {
layer.msg('AI助手初始化失败', {
7 months ago
icon: 2,
time: 2000
});
}
7 months ago
layer.close(loadIndex);
},
error: function (xhr, status, error) {
layer.close(loadIndex);
layer.msg("AI助手异常请稍后再试", {
icon: 2,
time: 2000
});
7 months ago
}
});
}
7 months ago
},
error: function (xhr, status, error) {
layer.msg("AI助手异常请稍后再试", {
icon: 2,
time: 2000
});
7 months ago
}
});
7 months ago
});
</script>
</body>
</html>