├── .DS_Store
├── .gitignore
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
├── favicon.ico
└── index.html
├── src
├── .DS_Store
├── App.vue
├── assets
│ ├── .DS_Store
│ └── img
│ │ ├── .DS_Store
│ │ ├── admin1.jpeg
│ │ ├── admin2.png
│ │ ├── admin3.png
│ │ ├── admin4.png
│ │ ├── admin5.png
│ │ ├── loginImg.jpg
│ │ └── verterLogo.png
├── components
│ ├── FixHeader.vue
│ ├── NavLeft.vue
│ ├── QuillEdit.vue
│ └── config.js
├── main.js
├── router.js
├── style
│ └── varStyle.scss
└── view
│ ├── ArticalList.vue
│ ├── Index.vue
│ ├── Label.vue
│ └── Login.vue
└── vue.config.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/.DS_Store
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # app
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 | ### 基于vue和element的个人博客后台管理系统
18 |
19 |
20 | 
21 |
22 | 
23 |
24 | 
25 |
26 | 
27 |
28 | 
29 |
30 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.19.0",
12 | "core-js": "^2.6.5",
13 | "element-ui": "^2.12.0",
14 | "node-sass": "^4.12.0",
15 | "sass-loader": "^8.0.0",
16 | "vue": "^2.6.10",
17 | "vue-quill-editor": "^3.0.6",
18 | "vue-router": "^3.1.3"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "^3.10.0",
22 | "@vue/cli-plugin-eslint": "^3.10.0",
23 | "@vue/cli-service": "^3.10.0",
24 | "babel-eslint": "^10.0.1",
25 | "eslint": "^5.16.0",
26 | "eslint-plugin-vue": "^5.0.0",
27 | "vue-template-compiler": "^2.6.10"
28 | },
29 | "eslintConfig": {
30 | "root": true,
31 | "env": {
32 | "node": true
33 | },
34 | "extends": [
35 | "plugin:vue/essential",
36 | "eslint:recommended"
37 | ],
38 | "rules": {},
39 | "parserOptions": {
40 | "parser": "babel-eslint"
41 | }
42 | },
43 | "postcss": {
44 | "plugins": {
45 | "autoprefixer": {}
46 | }
47 | },
48 | "browserslist": [
49 | "> 1%",
50 | "last 2 versions"
51 | ]
52 | }
53 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | guoliao&zhangjing后台管理系统
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/.DS_Store
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
28 |
--------------------------------------------------------------------------------
/src/assets/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/.DS_Store
--------------------------------------------------------------------------------
/src/assets/img/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/.DS_Store
--------------------------------------------------------------------------------
/src/assets/img/admin1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/admin1.jpeg
--------------------------------------------------------------------------------
/src/assets/img/admin2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/admin2.png
--------------------------------------------------------------------------------
/src/assets/img/admin3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/admin3.png
--------------------------------------------------------------------------------
/src/assets/img/admin4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/admin4.png
--------------------------------------------------------------------------------
/src/assets/img/admin5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/admin5.png
--------------------------------------------------------------------------------
/src/assets/img/loginImg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/loginImg.jpg
--------------------------------------------------------------------------------
/src/assets/img/verterLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhjing1019/blogVueAdmin/c9af470cf6696cd273a405582276a2663f46b60f/src/assets/img/verterLogo.png
--------------------------------------------------------------------------------
/src/components/FixHeader.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
22 |
23 |
61 |
--------------------------------------------------------------------------------
/src/components/NavLeft.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 |
31 |
32 |
42 |
--------------------------------------------------------------------------------
/src/components/QuillEdit.vue:
--------------------------------------------------------------------------------
1 |
2 |
44 |
45 |
207 |
292 |
--------------------------------------------------------------------------------
/src/components/config.js:
--------------------------------------------------------------------------------
1 |
2 | export const label =[
3 | {
4 | index: "1",
5 | label: "分类管理",
6 | path: "label",
7 | icon: "el-icon-collection-tag"
8 | },
9 | {
10 | index: "2",
11 | label: "文章列表",
12 | path: "articalList",
13 | icon: "el-icon-document"
14 | }
15 | ]
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import ElementUI from 'element-ui';
4 | import 'element-ui/lib/theme-chalk/index.css';
5 | import router from "./router.js";
6 | import axios from "axios";
7 |
8 | Vue.use(ElementUI);
9 | Vue.use(axios);
10 |
11 | // // 添加请求拦截器,在请求头中加token
12 | // axios.interceptors.request.use(
13 | // config => {
14 | // if (localStorage.getItem('Authorization')) {
15 | // config.headers.Authorization = localStorage.getItem('Authorization');
16 | // }
17 |
18 | // return config;
19 | // },
20 | // error => {
21 | // return Promise.reject(error);
22 | // });
23 |
24 |
25 | //异步请求前在header里加入token
26 | axios.interceptors.request.use(
27 | config => {
28 | // if (config.url === "") {
29 | //如果是登录操作,则不需要携带header里面的token
30 | // } else {
31 | if (localStorage.getItem("Authorization")) {
32 | config.headers["x-cms-token"] = localStorage.getItem("Authorization");
33 | }
34 | // }
35 | return config;
36 | },
37 | error => {
38 | return Promise.reject(error);
39 | }
40 | );
41 | //异步请求后,判断token是否过期
42 | axios.interceptors.response.use(
43 | response => {
44 | return response;
45 | },
46 | error => {
47 | if (error.response) {
48 | switch (error.response.status) {
49 | case 401:
50 | localStorage.removeItem("Authorization");
51 | this.$router.push("/");
52 | }
53 | }
54 | }
55 | );
56 |
57 |
58 | Vue.config.productionTip = false
59 |
60 | new Vue({
61 | router,
62 | render: h => h(App),
63 | }).$mount('#app')
64 |
--------------------------------------------------------------------------------
/src/router.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Router from "vue-router";
3 | import Label from "@/view/Label.vue";
4 | import ArticalList from "@/view/ArticalList.vue";
5 | import Index from "@/view/Index.vue";
6 | import Login from "@/view/Login.vue";
7 |
8 |
9 | Vue.use(Router);
10 |
11 | const router = new Router({
12 | routes: [
13 | {
14 | path: "/",
15 | name: "Login",
16 | component: Login
17 | },
18 | {
19 | path: "/index",
20 | name: "Index",
21 | component: Index,
22 | children: [
23 | {
24 | path: "/label",
25 | name: "Label",
26 | component: Label
27 | },
28 | {
29 | path: "/label",
30 | name: "Label",
31 | component: Label
32 | },
33 | {
34 | path: "/articalList",
35 | name: "ArticalList",
36 | component: ArticalList
37 | }
38 | ],
39 | redirect: "/label"
40 | },
41 |
42 | ]
43 | });
44 |
45 | // 导航守卫
46 | // 使用 router.beforeEach 注册一个全局前置守卫,判断用户是否登陆
47 | router.beforeEach((to, from, next) => {
48 | if (to.path === '/') {
49 | next();
50 | } else {
51 | let token = localStorage.getItem('Authorization');
52 |
53 | if (token === 'null' || token === '') {
54 | next('/');
55 | } else {
56 | next();
57 | }
58 | }
59 | });
60 |
61 | export default router;
62 |
63 |
--------------------------------------------------------------------------------
/src/style/varStyle.scss:
--------------------------------------------------------------------------------
1 | $theme-color: #606266;
2 | $font-color: #303133;
3 | $bg-color: #f4f5f5;
4 | $max-width: 960px;
5 | $border-el: 1px solid #EBEEF5
--------------------------------------------------------------------------------
/src/view/ArticalList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
新建文章
4 |
5 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
21 |
22 |
23 |
26 | 删除
30 |
31 |
32 | {{new Date(scope.row[item.prop])}}
33 |
34 |
35 | {{ scope.row[item.prop] }}
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
48 |
49 |
50 | 预览
53 | 删除
57 |
58 |
59 | {{ scope.row[item.prop] }}
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
81 |
82 |
83 |
84 |
85 |
86 |
210 |
211 |
232 |
--------------------------------------------------------------------------------
/src/view/Index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
37 |
--------------------------------------------------------------------------------
/src/view/Label.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 新建分类
5 |
6 |
9 |
12 |
13 |
14 | Edit
17 |
21 |
22 |
23 |
24 | {{tag.name}}
25 | 、
26 |
27 |
28 |
29 | {{ scope.row[item.prop] }}
30 |
31 |
32 |
33 |
34 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
62 |
63 |
64 | 删除
65 |
66 |
67 | 新增标签
68 |
69 |
70 |
71 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
205 |
206 |
--------------------------------------------------------------------------------
/src/view/Login.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Login
15 |
16 |
17 |
18 |
19 |
20 |
21 |
71 |
72 |
108 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | devServer: {
3 | proxy: 'http://192.168.0.107:8081/'
4 | }
5 | }
--------------------------------------------------------------------------------