模版更新

This commit is contained in:
xiongxiaoyang 2025-03-23 11:50:44 +08:00
parent f043ddff42
commit a06132a4c2
2 changed files with 19 additions and 4 deletions

View File

@ -347,8 +347,12 @@
success: function(res){
layer.close(loading);
// 将生成的内容追加到文本末尾
const newText = "\n\n" + res.data; // 添加换行符分隔
typeWriter(textarea, newText); // 使用打字机效果
if(res.code == '200'){
const newText = "\n\n【AI生成内容】" + res.data; // 添加换行符分隔
typeWriter(textarea, newText); // 使用打字机效果
}else{
layer.msg('AI内容生成失败请稍后重试');
}
},
error: function(){
layer.msg('请求失败请稍后重试');

View File

@ -51,7 +51,8 @@
</div>
<div class="my_r">
<div id="noContentDiv">
<div class="tc" style="margin-top: 200px"><a href="/author/book_add.html" class="btn_red">创建作品</a></div>
<div class="tc" style="margin-top: 200px"><a href="/author/book_add.html" class="btn_red">创建作品</a>
</div>
</div>
<div class="my_bookshelf" id="hasContentDiv" style="display: none">
@ -142,10 +143,13 @@
<script src="/javascript/common.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var searchCount = 0;
var timeout;
search(1, 5);
function search(curr, limit) {
searchCount++;
clearTimeout(timeout);
$.ajax({
type: "get",
url: "/author/listBookByPage",
@ -155,6 +159,7 @@
if (data.code == 200) {
var bookList = data.data.list;
if (bookList.length > 0) {
var aiPicGenerating = bookList[0].picUrl == '/images/default.gif'
$("#hasContentDiv").css("display", "block");
$("#noContentDiv").css("display", "none");
var bookListHtml = "";
@ -226,6 +231,12 @@
});
});
if (curr === 1 && aiPicGenerating && searchCount < 10) {
timeout = setTimeout(function () {
search(curr, limit);
}, 3000);
}
}