diff --git a/src/apis/articleManagement.js b/src/apis/articleManagement.js index 4d99c214bb1bae39ea89f07aeaa7b4deb9780d7b..a11b2f77043af4d3c4cad3bd4bac2d51e1430b44 100644 --- a/src/apis/articleManagement.js +++ b/src/apis/articleManagement.js @@ -3,10 +3,36 @@ export const getAllArticleInfo = vm =>{ url:'/article/getAllArticleInfo', method:'get' }).then(res => { - res.data.articleInfo.forEach(element => { + let color = ['error','primary','success','yellow','orange']; + res.data.articleInfo.forEach((element, index) => { vm.articles.push(element); + // console.log(element); + if(element.tag){ + vm.tags.push({tagName:element.tag,tagColor:color[index%5]}); + } }); + // console.log(vm.tags); }).catch(error => { console.log("error", error); }) + +} + +export const updateArticleList = (vm, tag) =>{ + vm.$axios.request({ + url:'/article/updateArticleList', + method:'get', + params:{ + tag + } + }).then(res => { + vm.articles.splice(0); + console.log(vm.articles); + res.data.articleInfo.forEach(element => { + vm.articles.push(element); + }) + // console.log(res); + }).catch( error => { + console.log('error', error); + }) } \ No newline at end of file diff --git a/src/apis/markdownEditor.js b/src/apis/markdownEditor.js index 38af189e5fa18c1c86680f32bdb8e7e22dcfd0b6..59321191c3185668651179c593434bcff119eeaa 100644 --- a/src/apis/markdownEditor.js +++ b/src/apis/markdownEditor.js @@ -26,4 +26,22 @@ export const submitContent = vm =>{ }).catch(error => { console.log('error', error); }) -} \ No newline at end of file +} + + +export const getAllTagInfo = vm =>{ + vm.$axios.request({ + url:'/article/getAllArticleInfo', + method:'get' + }).then(res => { + res.data.articleInfo.forEach((element, index) => { + if(element.tag){ + vm.tags.push(element.tag); + } + }); + }).catch(error => { + console.log("error", error); + }) + +} + diff --git a/src/views/Home.vue b/src/views/Home.vue index 68469edaa0f4738e9ac30d139f4d88e3c451d008..49c51288906bf05f3f6db5f83267aee5739fb486 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -177,7 +177,7 @@ export default { } .content{ - height: calc(~"100vh - 50px"); + min-height: calc(~"100vh - 50px"); width: calc( ~"100wh-200px"); background-color: aliceblue; } diff --git a/src/views/article-detail/articleDetail.vue b/src/views/article-detail/articleDetail.vue index 647d3e7effb93647fd5798181cf02b9218c4e151..72672a8767bd4a5173b2d83cad9be39a713bc225 100644 --- a/src/views/article-detail/articleDetail.vue +++ b/src/views/article-detail/articleDetail.vue @@ -1,7 +1,10 @@