├── .vscode
└── extensions.json
├── vite.config.js
├── src
├── api
│ ├── user.js
│ └── article.js
├── assets
│ ├── logo.jpg
│ ├── avatar.jpg
│ ├── cover.jpg
│ ├── default.png
│ ├── login1.jpg
│ ├── login2.jpg
│ └── main.scss
├── router
│ └── index.js
├── stores
│ ├── userInfo.js
│ └── token.js
├── App.vue
├── main.js
├── utils
│ └── request.js
└── views
│ ├── user
│ ├── UserInfo.vue
│ ├── UserAvatar.vue
│ └── UserResetPassword.vue
│ ├── article
│ ├── ArticleCategory.vue
│ └── ArticleManage.vue
│ ├── Login.vue
│ └── Layout.vue
├── public
└── favicon.ico
├── jsconfig.json
├── index.html
├── .gitignore
├── README.md
└── package.json
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar"]
3 | }
4 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/vite.config.js
--------------------------------------------------------------------------------
/src/api/user.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/api/user.js
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/api/article.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/api/article.js
--------------------------------------------------------------------------------
/src/assets/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/logo.jpg
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/router/index.js
--------------------------------------------------------------------------------
/src/assets/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/avatar.jpg
--------------------------------------------------------------------------------
/src/assets/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/cover.jpg
--------------------------------------------------------------------------------
/src/assets/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/default.png
--------------------------------------------------------------------------------
/src/assets/login1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/login1.jpg
--------------------------------------------------------------------------------
/src/assets/login2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/assets/login2.jpg
--------------------------------------------------------------------------------
/src/stores/userInfo.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dl0520dl/big-event/HEAD/src/stores/userInfo.js
--------------------------------------------------------------------------------
/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./src/*"]
5 | }
6 | },
7 | "exclude": ["node_modules", "dist"]
8 | }
9 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/assets/main.scss:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | background-color: #f5f5f5;
4 | }
5 |
6 | /* fade-slide */
7 | .fade-slide-leave-active,
8 | .fade-slide-enter-active {
9 | transition: all 0.3s;
10 | }
11 |
12 | .fade-slide-enter-from {
13 | transform: translateX(-30px);
14 | opacity: 0;
15 | }
16 |
17 | .fade-slide-leave-to {
18 | transform: translateX(30px);
19 | opacity: 0;
20 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
30 | *.tsbuildinfo
31 |
--------------------------------------------------------------------------------
/src/stores/token.js:
--------------------------------------------------------------------------------
1 | //定义store
2 | import {defineStore} from 'pinia'
3 | import {ref} from 'vue'
4 |
5 | export const useTokenStore = defineStore('token',()=>{
6 |
7 | const token = ref('')
8 | const setToken = (newToken)=>{
9 | token.value = newToken
10 | }
11 |
12 | const removeToken = ()=>{
13 | token.value = ''
14 | }
15 | return {
16 | token, setToken, removeToken
17 | }
18 | },{
19 | //持久化存储
20 | persist:true
21 | });
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # big-event前端代码
2 | springBoot + vue3
3 |
4 | ### 项目运行
5 |
6 | ```sh
7 | npm run dev
8 | ```
9 |
10 | ### 页面概览
11 | 
12 |
13 | 
14 |
15 | 
16 |
17 | 
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "big-event",
3 | "version": "0.0.0",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "@vueup/vue-quill": "^1.2.0",
13 | "axios": "^1.7.2",
14 | "element-plus": "^2.7.8",
15 | "pinia": "^2.2.0",
16 | "pinia-persistedstate-plugin": "^0.1.0",
17 | "vue": "^3.4.29",
18 | "vue-router": "^4.4.2"
19 | },
20 | "devDependencies": {
21 | "@vitejs/plugin-vue": "^5.0.5",
22 | "sass": "^1.77.8",
23 | "vite": "^5.3.1"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import './assets/main.scss'
2 |
3 | import { createApp } from 'vue'
4 |
5 | import ElementPlus from 'element-plus'
6 |
7 | import 'element-plus/dist/index.css'
8 |
9 | import App from './App.vue'
10 |
11 | import router from '@/router'
12 |
13 | import {createPinia} from 'pinia'
14 |
15 | import { createPersistedState } from 'pinia-persistedstate-plugin'
16 |
17 | import locale from 'element-plus/dist/locale/zh-cn.js'
18 |
19 | const app = createApp(App);
20 | const pinia = createPinia();
21 | const persist = createPersistedState();
22 | pinia.use(persist)
23 | app.use(pinia)
24 | app.use(ElementPlus, {locale})
25 | app.use(router)
26 |
27 | app.mount('#app')
--------------------------------------------------------------------------------
/src/utils/request.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | import { ElMessage } from 'element-plus'
4 |
5 | import { useTokenStore } from '@/stores/token.js';
6 | const baseURL = '/api';
7 | const instance = axios.create({baseURL})
8 |
9 | instance.interceptors.request.use(
10 | (config)=>{
11 | const tokenStore = useTokenStore();
12 | if(tokenStore.token){
13 | config.headers.Authorization = tokenStore.token
14 | }
15 | return config;
16 | },
17 | (err)=>{
18 | Promise.reject(err)
19 | }
20 | )
21 |
22 | import router from '@/router'
23 |
24 |
25 |
26 | instance.interceptors.response.use(
27 | result=>{
28 |
29 | if(result.data.code === 0){
30 | return result.data;
31 | }
32 |
33 | ElMessage.error(result.data.msg ? result.data.msg : '服务异常')
34 |
35 | return Promise.reject(result.data)
36 | },
37 | err=>{
38 | //判断响应状态码,如果为401,则证明未登录,提示登录,并跳转登陆页面
39 | if(err.response.status === 401){
40 | ElMessage.error('请先登录')
41 | router.push('/login')
42 | }else{
43 | ElMessage.error('服务异常');
44 | }
45 |
46 | return Promise.reject(err);
47 | }
48 | )
49 |
50 | export default instance;
--------------------------------------------------------------------------------
/src/views/user/UserInfo.vue:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | 提交修改
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/src/views/user/UserAvatar.vue:
--------------------------------------------------------------------------------
1 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
42 |
43 |
53 |
54 |
55 |
56 |
57 |
58 | 选择图片
59 |
60 |
61 | 上传头像
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/views/user/UserResetPassword.vue:
--------------------------------------------------------------------------------
1 |
113 |
114 |
115 |
116 |
117 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | 确认修改
135 |
136 |
137 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/src/views/article/ArticleCategory.vue:
--------------------------------------------------------------------------------
1 |
120 |
121 |
122 |
123 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/src/views/Login.vue:
--------------------------------------------------------------------------------
1 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | 注册
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | 注册
109 |
110 |
111 |
112 |
113 | ← 返回
114 |
115 |
116 |
117 |
118 |
119 |
120 | 登录
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | 记住我
131 | 忘记密码?
132 |
133 |
134 |
135 |
136 | 登录
137 |
138 |
139 |
140 | 注册 →
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/src/views/Layout.vue:
--------------------------------------------------------------------------------
1 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
82 |
83 |
84 |
85 |
86 | 文章分类
87 |
88 |
89 |
90 |
91 |
92 | 文章管理
93 |
94 |
95 |
96 |
97 |
98 |
99 | 个人中心
100 |
101 |
102 |
103 |
104 |
105 | 基本资料
106 |
107 |
108 |
109 |
110 |
111 | 更换头像
112 |
113 |
114 |
115 |
116 |
117 | 重置密码
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | 用户:{{ userInfoStore.info.nickname ? userInfoStore.info.nickname : userInfoStore.info.username }}
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 基本资料
137 | 更换头像
138 | 修改密码
139 | 退出登录
140 |
141 |
142 |
143 |
144 |
145 |
146 |
149 |
150 |
151 |
152 | 2024 Created by deligede
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/src/views/article/ArticleManage.vue:
--------------------------------------------------------------------------------
1 |
226 |
227 |
228 |
229 |
235 |
236 |
237 |
238 |
239 |
240 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 | 搜索
257 | 重置
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 | 发布
314 | 草稿
315 |
316 |
317 |
318 |
319 |
320 |
--------------------------------------------------------------------------------