Skip to content

Commit

Permalink
feat: board need auth
Browse files Browse the repository at this point in the history
  • Loading branch information
wmui committed Jun 26, 2023
1 parent 854c519 commit 626a2ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ module.exports = app => {
// 数据同步
router.get('/api/cnblogs', controller.post.cnblogsSync);
// 留言板
router.get('/board', controller.option.boardTmp);
router.post('/api/board', controller.option.boardSave);
router.get('/board', auth(true), controller.option.boardTmp);
router.post('/api/board', auth(), controller.option.boardSave);
router.delete('/api/board/:id', auth(), controller.option.boardDel);
// 其他
router.get('*', controller.post.not);
Expand Down
4 changes: 3 additions & 1 deletion app/view/theme/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
<% for(var i = 0; i < menus.length; i++) {%>
<li><a href="/post?id=<%=menus[i].id%>" class="nav-item"><%= menus[i].title %></a></li>
<%}%>
<li><a href="/board" class="nav-item">大吐槽</a></li>
<% if(loginStatus.status === 1){%>
<li><a href="/board" class="nav-item">大吐槽</a></li>
<%}%>
<% if(loginStatus.status === 1){%>
<li><a href="/setting" class="nav-item">设置</a></li>
<%}%>
Expand Down

0 comments on commit 626a2ca

Please sign in to comment.