Skip to content

Commit e9d55de

Browse files
committed
内容管理前端Vue
1 parent 8f77cbc commit e9d55de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+18035
-0
lines changed

blog-cms/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

blog-cms/package-lock.json

Lines changed: 10777 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blog-cms/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "blog-cms",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build"
8+
},
9+
"dependencies": {
10+
"axios": "^0.21.1",
11+
"core-js": "^3.6.5",
12+
"echarts": "^4.9.0",
13+
"element-ui": "^2.13.2",
14+
"lodash": "^4.17.19",
15+
"moment": "^2.27.0",
16+
"nprogress": "^0.2.0",
17+
"vditor": "^3.4.0",
18+
"vue": "^2.6.11",
19+
"vue-router": "^3.2.0",
20+
"vuex": "^3.4.0"
21+
},
22+
"devDependencies": {
23+
"@vue/cli-plugin-babel": "~4.4.0",
24+
"@vue/cli-plugin-router": "~4.4.0",
25+
"@vue/cli-plugin-vuex": "~4.4.0",
26+
"@vue/cli-service": "~4.4.0",
27+
"vue-template-compiler": "^2.6.11"
28+
},
29+
"browserslist": [
30+
"> 1%",
31+
"last 2 versions",
32+
"not dead"
33+
]
34+
}

blog-cms/public/favicon.ico

4.19 KB
Binary file not shown.

blog-cms/public/img/avatar.jpg

70.2 KB
Loading
70.2 KB
Loading
27 KB
Loading

blog-cms/public/img/visitor.jpg

70.2 KB
Loading

blog-cms/public/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title>后台管理 - NBlog</title>
9+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/yoyling/JsDelivr/prism/prism.css">
10+
</head>
11+
<body>
12+
<noscript>
13+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
14+
</noscript>
15+
<div id="app"></div>
16+
<script src="https://cdn.jsdelivr.net/gh/Naccl/blog-resource/prism/tomorrow-night/prism.min.js" data-manual></script>
17+
</body>
18+
</html>

blog-cms/src/App.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<div id="app">
3+
<router-view/>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import {getWebTitleSuffix} from "@/api/siteSetting";
9+
import {SAVE_WEB_TITLE_SUFFIX} from "@/store/mutations-types";
10+
export default {
11+
name: 'app',
12+
created() {
13+
this.getWebTitleSuffix()
14+
},
15+
methods: {
16+
getWebTitleSuffix() {
17+
getWebTitleSuffix().then(res => {
18+
if (res.code === 200) {
19+
this.$store.commit(SAVE_WEB_TITLE_SUFFIX, res.data)
20+
document.title = this.$route.meta.title + res.data
21+
}
22+
})
23+
},
24+
}
25+
}
26+
</script>
27+
28+
<style>
29+
30+
</style>

blog-cms/src/api/ExceptionLog.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getExceptionLogList(queryInfo) {
4+
return axios({
5+
url: 'exceptionLogs',
6+
method: 'GET',
7+
params: {
8+
...queryInfo
9+
}
10+
})
11+
}
12+
13+
export function deleteExceptionLogById(id) {
14+
return axios({
15+
url: 'exceptionLog',
16+
method: 'DELETE',
17+
params: {
18+
id
19+
}
20+
})
21+
}

blog-cms/src/api/about.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getAbout() {
4+
return axios({
5+
url: 'about',
6+
method: 'GET'
7+
})
8+
}
9+
10+
export function updateAbout(form) {
11+
return axios({
12+
url: 'about',
13+
method: 'PUT',
14+
data: {
15+
...form
16+
}
17+
})
18+
}

blog-cms/src/api/blog.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getDataByQuery(queryInfo) {
4+
return axios({
5+
url: 'blogs',
6+
method: 'GET',
7+
params: {
8+
...queryInfo
9+
}
10+
})
11+
}
12+
13+
export function deleteBlogById(id) {
14+
return axios({
15+
url: 'blog',
16+
method: 'DELETE',
17+
params: {
18+
id
19+
}
20+
})
21+
}
22+
23+
export function getCategoryAndTag() {
24+
return axios({
25+
url: 'categoryAndTag',
26+
method: 'GET'
27+
})
28+
}
29+
30+
export function saveBlog(blog) {
31+
return axios({
32+
url: 'blog',
33+
method: 'POST',
34+
data: {
35+
...blog
36+
}
37+
})
38+
}
39+
40+
export function updateTop(id, top) {
41+
return axios({
42+
url: 'blog/top',
43+
method: 'PUT',
44+
params: {
45+
id,
46+
top
47+
}
48+
})
49+
}
50+
51+
export function updateRecommend(id, recommend) {
52+
return axios({
53+
url: 'blog/recommend',
54+
method: 'PUT',
55+
params: {
56+
id,
57+
recommend
58+
}
59+
})
60+
}
61+
62+
export function updateVisibility(id, form) {
63+
return axios({
64+
url: `blog/${id}/visibility`,
65+
method: 'PUT',
66+
data: {
67+
...form
68+
}
69+
})
70+
}
71+
72+
export function getBlogById(id) {
73+
return axios({
74+
url: 'blog',
75+
method: 'GET',
76+
params: {
77+
id
78+
}
79+
})
80+
}
81+
82+
export function updateBlog(blog) {
83+
return axios({
84+
url: 'blog',
85+
method: 'PUT',
86+
data: {
87+
...blog
88+
}
89+
})
90+
}

blog-cms/src/api/category.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getData(queryInfo) {
4+
return axios({
5+
url: 'categories',
6+
method: 'GET',
7+
params: {
8+
...queryInfo
9+
}
10+
})
11+
}
12+
13+
export function addCategory(form) {
14+
return axios({
15+
url: 'category',
16+
method: 'POST',
17+
data: {
18+
...form
19+
}
20+
})
21+
}
22+
23+
export function editCategory(form) {
24+
return axios({
25+
url: 'category',
26+
method: 'PUT',
27+
data: {
28+
...form
29+
}
30+
})
31+
}
32+
33+
export function deleteCategoryById(id) {
34+
return axios({
35+
url: 'category',
36+
method: 'DELETE',
37+
params: {
38+
id
39+
}
40+
})
41+
}

blog-cms/src/api/comment.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getCommentListByQuery(queryInfo) {
4+
return axios({
5+
url: 'comments',
6+
method: 'GET',
7+
params: {
8+
...queryInfo
9+
}
10+
})
11+
}
12+
13+
export function getBlogList() {
14+
return axios({
15+
url: 'blogIdAndTitle',
16+
method: 'GET'
17+
})
18+
}
19+
20+
export function updatePublished(id, published) {
21+
return axios({
22+
url: 'comment/published',
23+
method: 'PUT',
24+
params: {
25+
id,
26+
published
27+
}
28+
})
29+
}
30+
31+
export function updateNotice(id, notice) {
32+
return axios({
33+
url: 'comment/notice',
34+
method: 'PUT',
35+
params: {
36+
id,
37+
notice
38+
}
39+
})
40+
}
41+
42+
export function deleteCommentById(id) {
43+
return axios({
44+
url: 'comment',
45+
method: 'DELETE',
46+
params: {
47+
id
48+
}
49+
})
50+
}
51+
52+
export function editComment(form) {
53+
return axios({
54+
url: 'comment',
55+
method: 'PUT',
56+
data: {
57+
...form
58+
}
59+
})
60+
}

blog-cms/src/api/dashboard.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import axios from '@/plugins/axios'
2+
3+
export function getDashboard() {
4+
return axios({
5+
url: 'dashboard',
6+
method: 'GET'
7+
})
8+
}

0 commit comments

Comments
 (0)