Skip to content

Commit 6d3c4e9

Browse files
fix: 修复了查看小说时的样式问题,同时修复了后端接口
1 parent 5e52ffd commit 6d3c4e9

File tree

10 files changed

+32
-22
lines changed

10 files changed

+32
-22
lines changed

blog/components/ChapterDetailed.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,30 @@ const ChapterDetailed = (props) => {
5555
<div className='pager'>
5656
{
5757
chapter.preId &&
58-
<Link href={`/chapterdetail?id=${chapter.preId}`}>
59-
<a className='item'>
60-
<span className='item-text'>上一章</span>
61-
</a>
62-
</Link>
58+
<div className='item'>
59+
<Link href={`/chapterdetail?id=${chapter.preId}`}>
60+
<a>
61+
<span className='item-text'>上一章</span>
62+
</a>
63+
</Link>
64+
</div>
6365
}
6466
<div className='item'>
6567
<Link href={`/noveldetail?id=${chapter.novelId}`}>
66-
<a className='item'>
67-
<span className='item-text'>目录</span>
68+
<a>
69+
<span className='item-text '>目录</span>
6870
</a>
6971
</Link>
7072
</div>
7173
{
7274
chapter.nextId &&
73-
<Link href={`/chapterdetail?id=${chapter.nextId}`}>
74-
<a className='item'>
75-
<span className='item-text'>下一章</span>
76-
</a>
77-
</Link>
75+
<div className='item'>
76+
<Link href={`/chapterdetail?id=${chapter.nextId}`}>
77+
<a>
78+
<span className='item-text'>下一章</span>
79+
</a>
80+
</Link>
81+
</div>
7882
}
7983
</div>
8084
<div className="comment-wrapper">

blog/components/Menu.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const myMenu = (props) => {
99
const navs = props.navs
1010
const router = props.router
1111
const [currentNav, setCurrentNav] = useState(navs[0]? navs[0].type: '')
12-
console.log(navs)
1312
// 通过Link导航(便于seo),每次进入的时候都会重新render组件,所以可以在生命周期中实现
1413
useEffect(()=>{
1514
for (const nav of navs) {

blog/components/NovelItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const NovelItem = (props)=>{
4949
<div className="introduce" dangerouslySetInnerHTML={{__html: marked(novel.summary)}}></div>
5050
<div className="view-content">
5151
<Link href={`/chapterdetail?id=${novel.id}`}>
52-
<a>查看全文 ></a>
52+
<a>查看全文 &gt;</a>
5353
</Link>
5454
</div>
5555
</div>

blog/config/apiBaseUrl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const vuebaseUrl = 'https://vue.immortalboy.cn'
22
const serverUrl = 'https://immortalboy.cn'
33
const imgServerUrl = 'https://iamge.immortalboy.cn'
4-
const baseUrl = 'https://immortalboy.cn/api/blog'
4+
// const baseUrl = 'https://immortalboy.cn/api/blog'
5+
const baseUrl = 'http://localhost:7001/api/blog'
56

67
const servicePath = {
78
visitorLogin: baseUrl + '/comment/visitorLogin', // 评论接口:获取文章列表

blog/public/style/components/articledetailed.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
.article-detailed .pager .item .item-text {
5656
padding: .5rem 1rem;
5757
font-size: 1.2rem;
58-
58+
color: #333333;
5959
}
6060

6161
.article-detailed .comment-wrapper .divider {

blog/public/style/components/noveldetailed.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
display: flex;
1010
}
1111
.novel-detailed .novel-info .info-left {
12-
padding: 0 1rem;
12+
padding: 1rem;
1313
}
1414
.novel-detailed .novel-info .info-left .img{
1515
height: 10rem;
@@ -46,7 +46,13 @@
4646
font-size: 13px;
4747
}
4848
.novel-detailed .novel-info .info-right .info-second {
49-
padding: 1rem 0;
49+
margin-top: 1rem;
50+
padding: .5rem;
51+
border-radius: .25rem;
52+
background-color: #f9f9f9;
53+
display: block;
54+
text-align: left;
55+
text-indent: 2rem;
5056
}
5157
.novel-detailed .chapter-list {
5258
background-color: #fff;

blogvue/src/components/Comment.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ export default {
354354
}
355355
},
356356
clickInput(e) {
357-
console.log(this.hasLogin)
358357
if (!this.hasLogin) {
359358
this.showLoginDialog = true
360359
// e.preventDefault()

service/app/controller/blog/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class IndexController extends controller {
195195
chapter.view_count AS viewCount, chapter.updatetime AS publishTime
196196
FROM novel_chapter AS chapter
197197
LEFT JOIN novel ON chapter.novel_id = novel.id
198-
WHERE chapter.id in(${chapterIdStr}) ORDER BY updatetime DESC`;
198+
WHERE chapter.id in(${chapterIdStr}) ORDER BY chapter.createtime DESC`;
199199
chapterListResult = await this.app.mysql.query(chapterListSql);
200200
}
201201
this.ctx.body = {

service/app/controller/blog/novel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ChapterController extends controller {
6565
const sqlResult = await this.app.mysql.query(sql, [ id ]);
6666
if (sqlResult.length > 0) {
6767
const result = sqlResult[0];
68-
const nextSql = `SELECT id, createtime FROM novel_chapter WHERE createtime
68+
const nextSql = `SELECT id, createtime AS createTime FROM novel_chapter WHERE createtime
6969
in((SELECT max(createtime) FROM novel_chapter WHERE createtime< ?),
7070
(SELECT min(createtime) FROM novel_chapter WHERE createtime> ?))`;
7171
const nextResult = await this.app.mysql.query(nextSql, [ result.createTime, result.createTime ]);

service/config/config.default.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module.exports = appInfo => {
2727
// database configuration
2828
client: {
2929
// host
30-
host: 'localhost',
30+
host: '129.211.106.174',
31+
// host: 'localhost',
3132
// port
3233
port: '3306',
3334
// username

0 commit comments

Comments
 (0)