Skip to content

change post to get #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions server/routes/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ router.post('/article/create',checkToken,function (req,res,next){
})
})
// 获取所有文章(带分页获取,需要验证权限)
router.post('/article/lists',checkToken,function (req,res,next){
router.get('/article/lists',checkToken,function (req,res,next){
let {page,limit} =req.body
api.getAllArticles(page,limit)
.then((result)=>{
Expand All @@ -48,7 +48,7 @@ router.post('/article/lists',checkToken,function (req,res,next){
})
})
// 根据classify获取文章列表(前台使用没有权限)
router.post('/article/noAuthArtilcelists',function (req,res,next){
router.get('/article/noAuthArtilcelists',function (req,res,next){

let {classify} =req.body
api.getArticlesByClassify(classify)
Expand All @@ -71,7 +71,7 @@ router.post('/article/noAuthArtilcelists',function (req,res,next){
})
})
// 获取所有文章(每次返回10个)前台使用
router.post('/article/articleLists',function (req,res,next){
router.get('/article/articleLists',function (req,res,next){
let {page,limit} =req.body
api.getAllArticles(page,limit)
.then((result)=>{
Expand Down Expand Up @@ -100,7 +100,7 @@ router.post('/article/articleLists',function (req,res,next){
})
})
// 根据postId获取其中一篇文章(有权限)
router.post('/article/onePage',checkToken,function (req,res,next){
router.get('/article/onePage',checkToken,function (req,res,next){
let {id} =req.body
api.getOneArticle(id)
.then((oneArticle)=>{
Expand All @@ -121,7 +121,7 @@ router.post('/article/onePage',checkToken,function (req,res,next){
})
}),
// 根据postId获取其中一篇文章(没有权限)
router.post('/article/noAuth',function (req,res,next){
router.get('/article/noAuth',function (req,res,next){
let {id} =req.body
api.getOneArticle(id)
.then((oneArticle)=>{
Expand Down