diff --git a/src/api/author.js b/src/api/author.js index 27060f8..35d0a80 100644 --- a/src/api/author.js +++ b/src/api/author.js @@ -8,10 +8,18 @@ export function register(params) { return request.post('/author/register', params); } -export function listBooks() { - return request.get('/author/books'); +export function listBooks(params) { + return request.get('/author/books', { params }); } export function publishBook(params) { return request.post('/author/book', params); +} + +export function listChapters(bookId, params) { + return request.get(`/author/book/chapters/${bookId}`, { params }); +} + +export function publishChapter(bookId,params) { + return request.post(`/author/book/chapter/${bookId}`, params); } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 8b645bf..a087649 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -82,6 +82,16 @@ const router = createRouter({ path: '/author/book_add', name: 'authorBookAdd', component: () => import('@/views/author/BookAdd') + }, + { + path: '/author/chapter_list', + name: 'authorChapterList', + component: () => import('@/views/author/ChapterList') + }, + { + path: '/author/chapter_add', + name: 'authorChapterAdd', + component: () => import('@/views/author/ChapterAdd') } ] }) diff --git a/src/views/Book.vue b/src/views/Book.vue index 97f797d..b5389da 100644 --- a/src/views/Book.vue +++ b/src/views/Book.vue @@ -36,7 +36,7 @@
-

+

收起 diff --git a/src/views/BookClass.vue b/src/views/BookClass.vue index 5f90e82..3b839c9 100644 --- a/src/views/BookClass.vue +++ b/src/views/BookClass.vue @@ -360,10 +360,10 @@ export default { computed: { wordCountFormat(wordCount) { return (wordCount) => { - if (wordCount.length > 5) { + if (wordCount.length >= 5) { return parseInt(wordCount / 10000) + "万"; } - if (wordCount.length > 4) { + if (wordCount.length >= 4) { return parseInt(wordCount / 1000) + "千"; } return wordCount; diff --git a/src/views/BookContent.vue b/src/views/BookContent.vue index 8169c33..e739655 100644 --- a/src/views/BookContent.vue +++ b/src/views/BookContent.vue @@ -113,7 +113,7 @@
diff --git a/src/views/author/BookAdd.vue b/src/views/author/BookAdd.vue index 1b22c81..fd28522 100644 --- a/src/views/author/BookAdd.vue +++ b/src/views/author/BookAdd.vue @@ -4,7 +4,8 @@
diff --git a/src/views/author/BookList.vue b/src/views/author/BookList.vue index eef5ba1..fd4424a 100644 --- a/src/views/author/BookList.vue +++ b/src/views/author/BookList.vue @@ -4,7 +4,8 @@
@@ -60,14 +61,10 @@ 0 {{ item.updateTime }} 更新 - 0 + {{ wordCountFormat(item.wordCount) }} - 章节管理 - + 章节管理 + @@ -168,10 +165,10 @@ export default { computed: { wordCountFormat(wordCount) { return (wordCount) => { - if (wordCount.length > 5) { + if (wordCount.length >= 5) { return parseInt(wordCount / 10000) + "万"; } - if (wordCount.length > 4) { + if (wordCount.length >= 4) { return parseInt(wordCount / 1000) + "千"; } return wordCount; diff --git a/src/views/author/ChapterAdd.vue b/src/views/author/ChapterAdd.vue new file mode 100644 index 0000000..641f052 --- /dev/null +++ b/src/views/author/ChapterAdd.vue @@ -0,0 +1,747 @@ + + + + + + + diff --git a/src/views/author/ChapterList.vue b/src/views/author/ChapterList.vue new file mode 100644 index 0000000..722bfd6 --- /dev/null +++ b/src/views/author/ChapterList.vue @@ -0,0 +1,753 @@ + + + + + + +