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

3 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;
var $ = layui.jquery;
$.ajax({
type: "GET",
dataType: "json",
async: false,
3 months ago
url: "/dsBase/maxkb/getApplication",
3 months ago
success: function (res) {
if (res.success) {
var appId = res.access_token;
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);
} else {
layer.msg('AI助手初始化中...', {
icon: 16,
shade: 0.01
});
$.ajax({
3 months ago
url: '/dsBase/maxkb/createApplication',
3 months ago
type: 'post',
async: true,
success: function (res) {
if (res.success) {
var appId = res.access_token;
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);
} else {
layer.msg('AI助手初始化失败', {
icon: 2,
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
});
}
});
});
</script>
</body>
</html>