Files
QingLong/WebRoot/index_ai.html
2025-08-15 09:13:13 +08:00

84 lines
3.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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) {
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({
url: '/QingLong/maxkb/createApplication',
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>