├── .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 | 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 | ![image](https://github.com/user-attachments/assets/2c99912f-1d94-4b72-9732-da6a20da7c85) 12 | 13 | ![image](https://github.com/user-attachments/assets/92b0b625-f1c2-4a8e-ad85-3270958e35b7) 14 | 15 | ![image](https://github.com/user-attachments/assets/4cabec41-2250-4b5a-bc10-4b7f902733c6) 16 | 17 | ![image](https://github.com/user-attachments/assets/3388bfd6-5d8c-424d-83c6-5e128cc7727c) 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 | -------------------------------------------------------------------------------- /src/views/user/UserAvatar.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 67 | 68 | -------------------------------------------------------------------------------- /src/views/user/UserResetPassword.vue: -------------------------------------------------------------------------------- 1 | 113 | 114 | 141 | -------------------------------------------------------------------------------- /src/views/article/ArticleCategory.vue: -------------------------------------------------------------------------------- 1 | 120 | 164 | 165 | -------------------------------------------------------------------------------- /src/views/Login.vue: -------------------------------------------------------------------------------- 1 | 86 | 87 | 147 | 148 | -------------------------------------------------------------------------------- /src/views/Layout.vue: -------------------------------------------------------------------------------- 1 | 74 | 75 | 156 | 157 | -------------------------------------------------------------------------------- /src/views/article/ArticleManage.vue: -------------------------------------------------------------------------------- 1 | 226 | 320 | --------------------------------------------------------------------------------