mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-26 09:20:50 +00:00
模版更新
This commit is contained in:
parent
f043ddff42
commit
a06132a4c2
@ -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('请求失败,请稍后重试');
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user