diff --git a/WebRoot/index_ai.html b/WebRoot/index_ai.html
index e747bb93..526e14c6 100644
--- a/WebRoot/index_ai.html
+++ b/WebRoot/index_ai.html
@@ -25,44 +25,61 @@
var $ = layui.jquery;
- // $.ajax({
- // type: "GET",
- // dataType: "json",
- // async: false,
- // url: "/QingLong/global/getGlobalByCodes",
- // success: function (res) {
- // if (res.success) {
-
- // var iframe = '';
-
- // } else {
- // var loadIndex = layer.msg('AI助手初始化中...', {
- // icon: 16,
- // shade: 0.01
- // });
-
+ $.ajax({
+ type: "GET",
+ dataType: "json",
+ async: false,
+ url: "/QingLong/maxkb/getApplication",
+ success: function (res) {
+ if (res.success) {
+ var appId = res.data;
+ var 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 = '';
+ $('body').append(iframe);
+ } else {
+ layer.close(loadIndex);
+ layer.msg(result.message, {
+ icon: 2,
+ time: 2000
+ });
+ }
+ }
+ });
+ }
+ }
+ });
- // var iframe = '';
- // }
- // }
+ // var loadIndex = layer.msg('AI助手初始化中...', {
+ // icon: 16,
+ // shade: 0.05
// });
- var loadIndex = layer.msg('AI助手初始化中...', {
- icon: 16,
- shade: 0.05
- });
-
-
- // 模拟关闭
- setTimeout(function () {
- layer.close(loadIndex);
- var appId = "5b45c7e216579a41";
- var iframe = '';
- $('body').append(iframe);
+ // // 模拟关闭
+ // setTimeout(function () {
+ // layer.close(loadIndex);
+ // var appId = "5b45c7e216579a41";
+ // var iframe = '';
+ // $('body').append(iframe);
- }, 1000);
+ // }, 1000);
});