From 1be33b8b244a461529a50ff4b184bbcf98d0e696 Mon Sep 17 00:00:00 2001 From: kgdxpr Date: Tue, 31 Dec 2024 14:59:07 +0800 Subject: [PATCH] 'commit' --- WebRoot/index_ai.html | 81 ++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 32 deletions(-) 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); });