var ajaxUrl = 'http://192.168.99.86:3001' $(function () { // 退出程序 $(".doubleExit").dblclick(function(){ if (confirm("确定退出?")) { console.log("确定"); } else { console.log("取消"); } }); // 首页样式操作 $('.list-left li').hover( function() { $(this).removeClass('animate__backInLeft').addClass('animate__headShake'); }, function() { $(this).removeClass('animate__headShake') } ); $('.list-right li').hover( function() { $(this).removeClass('animate__backInRight').addClass('animate__headShake'); }, function() { $(this).removeClass('animate__headShake') } ); // 首页菜单点击操作 $('.index-list li').on('click', function () { const _this = $(this) $('.ai-human').css('animation-duration', '0.2s').addClass('animate__animated animate__flash') setTimeout(function () { $('.list-left li').removeClass('animate__backInLeft').addClass('animate__animated animate__backOutLeft') $('.list-right li').removeClass('animate__backInRight').addClass('animate__animated animate__backOutRight') setTimeout(function(){ const href = _this.find('a').attr('id'); if (href === 'page1') { window.location.href = 'page1.html'; } else if (href === 'page2') { window.location.href = 'page2.html'; } else if (href === 'page3') { window.location.href = 'page3.html'; } else if (href === 'page4') { window.location.href = 'page4.html'; } else if (href === 'page5') { window.location.href = 'page5.html'; } else if (href === 'aiChat') { window.location.href = 'ai_chat.html'; } return false; },1000) }, 300) }) }) function FetchChatTalk () { $.ajax({ url: ajaxUrl + '/api/v1/workspace/dxhtsg/chat', type: 'POST', headers: { "Authorization": "Bearer XVSPT0T-6P54SZH-QP36QKJ-KK77TN6" }, contentType:'application/json', dataType: "json", data: JSON.stringify({ "message": '你是谁', "mode":"chat" }), success: function (res) { console.log('res',res) }, error: function (err) { console.log(err); } }); }