├── .DS_Store
├── .gitattributes
├── README.md
├── front
├── .gitignore
├── LICENSE
├── babel.config.js
├── package-lock.json
├── package.json
├── public
│ ├── favicon.ico
│ ├── img
│ │ └── icons
│ │ │ ├── android-chrome-192x192.png
│ │ │ ├── android-chrome-512x512.png
│ │ │ ├── android-chrome-maskable-192x192.png
│ │ │ ├── android-chrome-maskable-512x512.png
│ │ │ ├── apple-touch-icon-120x120.png
│ │ │ ├── apple-touch-icon-152x152.png
│ │ │ ├── apple-touch-icon-180x180.png
│ │ │ ├── apple-touch-icon-60x60.png
│ │ │ ├── apple-touch-icon-76x76.png
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── favicon-16x16.png
│ │ │ ├── favicon-32x32.png
│ │ │ ├── msapplication-icon-144x144.png
│ │ │ ├── mstile-150x150.png
│ │ │ └── safari-pinned-tab.svg
│ ├── index.html
│ └── robots.txt
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── 404_images
│ │ │ ├── 404.png
│ │ │ └── 404_cloud.png
│ │ ├── bg.jpg
│ │ ├── loginbg.png
│ │ └── logo.png
│ ├── axios.js
│ ├── components
│ │ ├── Aside.vue
│ │ ├── ChartThree.vue
│ │ ├── ECharts.vue
│ │ ├── Editor.vue
│ │ ├── Hamburger.vue
│ │ ├── Header.vue
│ │ ├── IFrame.vue
│ │ ├── InfiniteNews.vue
│ │ ├── Pagination.vue
│ │ ├── Rumor.vue
│ │ ├── Screenfull.vue
│ │ ├── SearchHeader.vue
│ │ ├── Tag.vue
│ │ ├── UserAvatar.vue
│ │ └── Vaccine.vue
│ ├── main.js
│ ├── plugins
│ │ ├── area.js
│ │ ├── element.js
│ │ ├── mock.js
│ │ └── modal.js
│ ├── registerServiceWorker.js
│ ├── router
│ │ └── index.js
│ ├── store
│ │ ├── index.js
│ │ ├── menu.js
│ │ └── side.js
│ ├── utils
│ │ └── scroll-to.js
│ └── views
│ │ ├── Home.vue
│ │ ├── Index
│ │ └── Index.vue
│ │ ├── Login.vue
│ │ ├── Register.vue
│ │ ├── UserCenter.vue
│ │ ├── access
│ │ ├── Register.vue
│ │ └── Return.vue
│ │ ├── error
│ │ └── 404.vue
│ │ ├── good
│ │ ├── Bar.vue
│ │ ├── Info.vue
│ │ ├── Pie.vue
│ │ ├── Stock.vue
│ │ ├── Total.vue
│ │ └── Type.vue
│ │ ├── health
│ │ ├── Clock.vue
│ │ ├── ClockInfo.vue
│ │ ├── Report.vue
│ │ └── ReportInfo.vue
│ │ ├── leave
│ │ ├── Apply.vue
│ │ └── Record.vue
│ │ ├── monitor
│ │ ├── Druid.vue
│ │ ├── Notice.vue
│ │ ├── Operate.vue
│ │ ├── Redis.vue
│ │ ├── Server.vue
│ │ └── Swagger.vue
│ │ └── sys
│ │ ├── Dept.vue
│ │ ├── LoginInfo.vue
│ │ ├── Menu.vue
│ │ ├── Role.vue
│ │ └── User.vue
└── yarn.lock
└── server
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── fanchen
│ │ ├── SystemAdminJavaApplication.java
│ │ ├── annotation
│ │ └── Log.java
│ │ ├── aspectj
│ │ └── LogAspectj.java
│ │ ├── common
│ │ ├── dto
│ │ │ ├── GoodDto.java
│ │ │ └── NavMenu.java
│ │ ├── exception
│ │ │ ├── CaptchaException.java
│ │ │ └── GlobalExceptionHandler.java
│ │ └── lang
│ │ │ ├── Const.java
│ │ │ └── Result.java
│ │ ├── config
│ │ ├── ApplicationConfig.java
│ │ ├── CorsConfig.java
│ │ ├── KaptchaConfig.java
│ │ ├── MyBatisPlusConfig.java
│ │ ├── RedisConfig.java
│ │ └── SecurityConfig.java
│ │ ├── controller
│ │ ├── AccessRegisterController.java
│ │ ├── AccessReturnController.java
│ │ ├── BaseController.java
│ │ ├── GoodInfoController.java
│ │ ├── GoodStockController.java
│ │ ├── GoodTypeController.java
│ │ ├── HealthClockController.java
│ │ ├── HealthReportController.java
│ │ ├── KaptchaController.java
│ │ ├── LeaveApplyController.java
│ │ ├── NewsController.java
│ │ ├── RedisController.java
│ │ ├── RegisterController.java
│ │ ├── ServerController.java
│ │ ├── SysDeptController.java
│ │ ├── SysLoginInfoController.java
│ │ ├── SysMenuController.java
│ │ ├── SysNoticeController.java
│ │ ├── SysOperateLogController.java
│ │ ├── SysRoleController.java
│ │ └── SysUserController.java
│ │ ├── entity
│ │ ├── AccessRegister.java
│ │ ├── AccessReturn.java
│ │ ├── GoodInfo.java
│ │ ├── GoodStock.java
│ │ ├── GoodType.java
│ │ ├── HealthClock.java
│ │ ├── HealthReport.java
│ │ ├── LeaveApply.java
│ │ ├── SysDept.java
│ │ ├── SysLoginInfo.java
│ │ ├── SysMenu.java
│ │ ├── SysNotice.java
│ │ ├── SysOperateLog.java
│ │ ├── SysRole.java
│ │ ├── SysRoleMenu.java
│ │ ├── SysUser.java
│ │ ├── SysUserRole.java
│ │ └── server
│ │ │ ├── Arith.java
│ │ │ ├── Cpu.java
│ │ │ ├── Jvm.java
│ │ │ ├── Mem.java
│ │ │ ├── Server.java
│ │ │ ├── Sys.java
│ │ │ └── SysFile.java
│ │ ├── handler
│ │ └── MyMetaObjectHandler.java
│ │ ├── mapper
│ │ ├── AccessRegisterMapper.java
│ │ ├── AccessReturnMapper.java
│ │ ├── GoodInfoMapper.java
│ │ ├── GoodStockMapper.java
│ │ ├── GoodTypeMapper.java
│ │ ├── HealthClockMapper.java
│ │ ├── HealthReportMapper.java
│ │ ├── LeaveApplyMapper.java
│ │ ├── SysDeptMapper.java
│ │ ├── SysLoginInfoMapper.java
│ │ ├── SysMenuMapper.java
│ │ ├── SysNoticeMapper.java
│ │ ├── SysOperateLogMapper.java
│ │ ├── SysRoleMapper.java
│ │ ├── SysRoleMenuMapper.java
│ │ ├── SysUserMapper.java
│ │ └── SysUserRoleMapper.java
│ │ ├── security
│ │ ├── AccountUser.java
│ │ ├── CaptchaFilter.java
│ │ ├── JwtAccessDeniedHandler.java
│ │ ├── JwtAuthenticationEntryPoint.java
│ │ ├── JwtAuthenticationFilter.java
│ │ ├── JwtLogoutSuccessHandler.java
│ │ ├── LoginFailHandler.java
│ │ ├── LoginSuccessHandler.java
│ │ └── UserDetailServiceImpl.java
│ │ ├── service
│ │ ├── AccessRegisterService.java
│ │ ├── AccessReturnService.java
│ │ ├── GoodInfoService.java
│ │ ├── GoodStockService.java
│ │ ├── GoodTypeService.java
│ │ ├── HealthClockService.java
│ │ ├── HealthReportService.java
│ │ ├── LeaveApplyService.java
│ │ ├── SysDeptService.java
│ │ ├── SysLoginInfoService.java
│ │ ├── SysMenuService.java
│ │ ├── SysNoticeService.java
│ │ ├── SysOperateLogService.java
│ │ ├── SysRoleMenuService.java
│ │ ├── SysRoleService.java
│ │ ├── SysUserRoleService.java
│ │ ├── SysUserService.java
│ │ └── impl
│ │ │ ├── AccessRegisterServiceImpl.java
│ │ │ ├── AccessReturnServiceImpl.java
│ │ │ ├── GoodInfoServiceImpl.java
│ │ │ ├── GoodStockServiceImpl.java
│ │ │ ├── GoodTypeServiceImpl.java
│ │ │ ├── HealthClockServiceImpl.java
│ │ │ ├── HealthReportServiceImpl.java
│ │ │ ├── LeaveApplyServiceImpl.java
│ │ │ ├── SysDeptServiceImpl.java
│ │ │ ├── SysLoginInfoServiceImpl.java
│ │ │ ├── SysMenuServiceImpl.java
│ │ │ ├── SysNoticeServiceImpl.java
│ │ │ ├── SysOperateLogServiceImpl.java
│ │ │ ├── SysRoleMenuServiceImpl.java
│ │ │ ├── SysRoleServiceImpl.java
│ │ │ ├── SysUserRoleServiceImpl.java
│ │ │ └── SysUserServiceImpl.java
│ │ └── utils
│ │ ├── AsyncTaskUtil.java
│ │ ├── CodeUtil.java
│ │ ├── DateUtils.java
│ │ ├── HTMLFilter.java
│ │ ├── HttpUtils.java
│ │ ├── IpUtils.java
│ │ ├── JwtUtil.java
│ │ ├── MimeTypeUtils.java
│ │ ├── RedisUtil.java
│ │ ├── SecurityUtil.java
│ │ ├── ServletUtil.java
│ │ └── UploadUtil.java
└── resources
│ ├── application.yml
│ ├── banner.txt
│ ├── logback-spring.xml
│ └── mapper
│ ├── AccessRegisterMapper.xml
│ ├── AccessReturnMapper.xml
│ ├── GoodInfoMapper.xml
│ ├── GoodStockMapper.xml
│ ├── GoodTypeMapper.xml
│ ├── HealthClockMapper.xml
│ ├── HealthReportMapper.xml
│ ├── LeaveApplyMapper.xml
│ ├── SysDeptMapper.xml
│ ├── SysLoginInfoMapper.xml
│ ├── SysMenuMapper.xml
│ ├── SysNoticeMapper.xml
│ ├── SysOperateLogMapper.xml
│ ├── SysRoleMapper.xml
│ ├── SysRoleMenuMapper.xml
│ ├── SysUserMapper.xml
│ └── SysUserRoleMapper.xml
└── test
└── java
└── com
└── fanchen
├── CodeGenerator.java
├── NewTest.java
└── SystemAdminJavaApplicationTests.java
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/.DS_Store
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=java
2 | *.css linguist-language=java
3 | *.html linguist-language=java
4 | *.vue linguist-language=java
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 全目录
2 |
3 | [更多系统、论文,供君选择 ~~>](https://www.yuque.com/wisebit/blog)
4 |
5 | # 225.EpidemicPreventionAndControlManagementSystem2
6 |
7 |
群: 983063232(入群获取sql文件)
8 | QQ: 206157502(加好友获取sql文件)
9 |
10 | 225.疫情防控管理系统
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | # 简介
21 |
22 |
23 | > 本代码来源于网络,仅供学习参考使用,请入群(983063232)后联系群主索要sql文件!
24 | >
25 | > 提供1.远程部署/2.修改代码/3.设计文档指导/4.框架代码讲解等服务
26 | >
27 | > 登录地址: http://localhost:8080
28 | >
29 | > 管理员: 用户名:admin 密码:123456
30 |
31 |
32 |
33 | # 环境
34 |
35 | - IntelliJ IDEA 2009.3
36 |
37 | - Mysql 5.7.26
38 |
39 | - Tomcat 7.0.73
40 |
41 | - JDK 1.8
42 |
43 |
44 |
45 |
46 | ## 缩略图
47 |
48 | 
49 | 
50 | 
51 | 
52 | 
53 | 
54 | 
55 | 
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/front/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/front/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/front/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "system-admin-vue",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.24.0",
11 | "core-js": "^3.6.5",
12 | "echarts": "^4.8.0",
13 | "element-ui": "^2.4.5",
14 | "fuse.js": "^6.5.3",
15 | "jsonp": "^0.2.1",
16 | "nprogress": "^0.2.0",
17 | "qs": "^6.10.1",
18 | "quill": "1.3.7",
19 | "register-service-worker": "^1.7.1",
20 | "screenfull": "4.2.0",
21 | "vue": "^2.6.11",
22 | "vue-cropper": "0.5.5",
23 | "vue-router": "^3.2.0",
24 | "vuex": "^3.4.0"
25 | },
26 | "devDependencies": {
27 | "@vue/cli-plugin-babel": "~4.5.0",
28 | "@vue/cli-plugin-pwa": "~4.5.0",
29 | "@vue/cli-plugin-router": "~4.5.0",
30 | "@vue/cli-plugin-vuex": "~4.5.0",
31 | "@vue/cli-service": "~4.5.0",
32 | "mockjs": "^1.1.0",
33 | "sass": "^1.56.0",
34 | "sass-loader": "^8.0.2",
35 | "vue-cli-plugin-element": "^1.0.1",
36 | "vue-template-compiler": "^2.6.11"
37 | },
38 | "browserslist": [
39 | "> 1%",
40 | "last 2 versions",
41 | "not dead"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/front/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/favicon.ico
--------------------------------------------------------------------------------
/front/public/img/icons/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/android-chrome-192x192.png
--------------------------------------------------------------------------------
/front/public/img/icons/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/android-chrome-512x512.png
--------------------------------------------------------------------------------
/front/public/img/icons/android-chrome-maskable-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/android-chrome-maskable-192x192.png
--------------------------------------------------------------------------------
/front/public/img/icons/android-chrome-maskable-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/android-chrome-maskable-512x512.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/front/public/img/icons/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/apple-touch-icon.png
--------------------------------------------------------------------------------
/front/public/img/icons/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/favicon-16x16.png
--------------------------------------------------------------------------------
/front/public/img/icons/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/favicon-32x32.png
--------------------------------------------------------------------------------
/front/public/img/icons/msapplication-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/msapplication-icon-144x144.png
--------------------------------------------------------------------------------
/front/public/img/icons/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/public/img/icons/mstile-150x150.png
--------------------------------------------------------------------------------
/front/public/img/icons/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/front/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 疫情防控系统
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/front/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/front/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
25 |
--------------------------------------------------------------------------------
/front/src/assets/404_images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/src/assets/404_images/404.png
--------------------------------------------------------------------------------
/front/src/assets/404_images/404_cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/src/assets/404_images/404_cloud.png
--------------------------------------------------------------------------------
/front/src/assets/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/src/assets/bg.jpg
--------------------------------------------------------------------------------
/front/src/assets/loginbg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/src/assets/loginbg.png
--------------------------------------------------------------------------------
/front/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JavaGraduationProject/EpidemicPreventionAndControlManagementSystem2/74d6eb87d8ada7977139b3ef8a3e1d2ec4ffc2cb/front/src/assets/logo.png
--------------------------------------------------------------------------------
/front/src/axios.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import Element from 'element-ui';
3 | import router from "./router";
4 |
5 | axios.defaults.baseURL = "http://localhost:8081"
6 | axios.defaults.withCredentials = false
7 |
8 | const request = axios.create({
9 | timeout: 5000,
10 | headers: {
11 | 'Content-Type': 'application/json; charset=utf-8'
12 | }
13 | });
14 |
15 | request.interceptors.request.use(config => {
16 | config.headers['Authorization'] = localStorage.getItem("token")
17 | return config
18 | });
19 |
20 | request.interceptors.response.use(response => {
21 | let res = response.data;
22 | if (res.code === 200) {
23 | return response;
24 | } else {
25 | Element.Message.error(res.msg ? res.msg : '系统异常!', {
26 | duration: 3 * 1000
27 | });
28 | return Promise.reject(response.data.msg);
29 | }
30 | }, error => {
31 | if (error.response.data) {
32 | error.message = error.response.data.msg;
33 | }
34 | if (error.response.status === 401) {
35 | if (router.currentRoute.path !== '/login'){
36 | router.push({path: '/login'})
37 | }
38 | }
39 | let doms= document.getElementsByClassName('el-message')[0]
40 | if (doms === undefined){
41 | Element.Message.error(error.message ? error.message : '操作失败', {
42 | duration: 3 * 1000
43 | });
44 | }
45 | return Promise.reject(error)
46 | })
47 |
48 | export default request
49 |
--------------------------------------------------------------------------------
/front/src/components/ECharts.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
97 |
98 |
--------------------------------------------------------------------------------
/front/src/components/Hamburger.vue:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
31 |
32 |
44 |
--------------------------------------------------------------------------------
/front/src/components/IFrame.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
37 |
--------------------------------------------------------------------------------
/front/src/components/InfiniteNews.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
67 |
68 |
89 |
--------------------------------------------------------------------------------
/front/src/components/Pagination.vue:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
98 |
99 |
109 |
--------------------------------------------------------------------------------
/front/src/components/Screenfull.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
53 |
54 |
63 |
--------------------------------------------------------------------------------
/front/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import './registerServiceWorker'
4 | import router from './router'
5 | import store from './store'
6 | import './plugins/element.js'
7 | import modal from "./plugins/modal";
8 | import Pagination from "@/components/Pagination";
9 | import axios from './axios'
10 |
11 | Vue.prototype.$axios = axios
12 | Vue.config.productionTip = false
13 | Vue.prototype.modal = modal
14 | Vue.component('Pagination', Pagination)
15 |
16 |
17 | const hasPermission = permission => {
18 | let permissionList = Array.isArray(permission) ? permission : [permission]
19 | let userPermission = store.state.menu.authoritys
20 | return userPermission.some(perm => permissionList.includes(perm))
21 | }
22 |
23 | const isAdmin = () => {
24 | let userRole = store.state.menu.authoritys
25 | return userRole.some(role => role === "ROLE_admin")
26 | }
27 |
28 | Vue.directive('permission', {
29 | inserted: (el, binding, vnode) => {
30 | if (!hasPermission(binding.value)){
31 | el.parentNode && el.parentNode.removeChild(el)
32 | }
33 | }
34 | })
35 |
36 | Vue.directive('isAdmin', {
37 | inserted: (el, binding, vnode) => {
38 | if (isAdmin()){
39 | el.parentNode && el.parentNode.removeChild(el)
40 | }
41 | }
42 | })
43 |
44 | Vue.prototype.$_has = hasPermission
45 |
46 | new Vue({
47 | router,
48 | store,
49 | render: h => h(App)
50 | }).$mount('#app')
51 |
--------------------------------------------------------------------------------
/front/src/plugins/element.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Element from 'element-ui'
3 | import 'element-ui/lib/theme-chalk/index.css'
4 |
5 | Vue.use(Element)
6 |
--------------------------------------------------------------------------------
/front/src/plugins/modal.js:
--------------------------------------------------------------------------------
1 | import { Message, MessageBox, Notification, Loading } from 'element-ui'
2 |
3 | let loadingInstance;
4 |
5 | export default {
6 | // 消息提示
7 | msg(content) {
8 | Message.info(content)
9 | },
10 | // 错误消息
11 | msgError(content) {
12 | Message.error(content)
13 | },
14 | // 成功消息
15 | msgSuccess(content) {
16 | Message.success(content)
17 | },
18 | // 警告消息
19 | msgWarning(content) {
20 | Message.warning(content)
21 | },
22 | // 弹出提示
23 | alert(content) {
24 | MessageBox.alert(content, "系统提示")
25 | },
26 | // 错误提示
27 | alertError(content) {
28 | MessageBox.alert(content, "系统提示", { type: 'error' })
29 | },
30 | // 成功提示
31 | alertSuccess(content) {
32 | MessageBox.alert(content, "系统提示", { type: 'success' })
33 | },
34 | // 警告提示
35 | alertWarning(content) {
36 | MessageBox.alert(content, "系统提示", { type: 'warning' })
37 | },
38 | // 通知提示
39 | notify(content) {
40 | Notification.info({
41 | title: '消息',
42 | message: content
43 | })
44 | },
45 | // 错误通知
46 | notifyError(content) {
47 | Notification.error({
48 | title: '错误',
49 | message: content
50 | });
51 | },
52 | // 成功通知
53 | notifySuccess(content) {
54 | Notification.success({
55 | title: '成功',
56 | message: content,
57 | type: 'success'
58 | })
59 | },
60 | // 警告通知
61 | notifyWarning(content) {
62 | Notification.warning({
63 | title: '警告',
64 | message: content,
65 | type: 'warning'
66 | })
67 | },
68 | // 确认窗体
69 | confirm(content) {
70 | return MessageBox.confirm(content, "系统提示", {
71 | confirmButtonText: '确定',
72 | cancelButtonText: '取消',
73 | type: "warning",
74 | })
75 | },
76 | // 打开遮罩层
77 | loading(content) {
78 | loadingInstance = Loading.service({
79 | lock: true,
80 | text: content,
81 | spinner: "el-icon-loading",
82 | background: "rgba(0, 0, 0, 0.7)",
83 | })
84 | },
85 | // 关闭遮罩层
86 | closeLoading() {
87 | loadingInstance.close();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/front/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 |
3 | import { register } from 'register-service-worker'
4 |
5 | if (process.env.NODE_ENV === 'production') {
6 | register(`${process.env.BASE_URL}service-worker.js`, {
7 | ready () {
8 | console.log(
9 | 'App is being served from cache by a service worker.\n' +
10 | 'For more details, visit https://goo.gl/AFskqB'
11 | )
12 | },
13 | registered () {
14 | console.log('Service worker has been registered.')
15 | },
16 | cached () {
17 | console.log('Content has been cached for offline use.')
18 | },
19 | updatefound () {
20 | console.log('New content is downloading.')
21 | },
22 | updated () {
23 | console.log('New content is available; please refresh.')
24 | },
25 | offline () {
26 | console.log('No internet connection found. App is running in offline mode.')
27 | },
28 | error (error) {
29 | console.error('Error during service worker registration:', error)
30 | }
31 | })
32 | }
33 |
--------------------------------------------------------------------------------
/front/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import side from './side'
4 | import menu from './menu'
5 |
6 | Vue.use(Vuex)
7 |
8 | export default new Vuex.Store({
9 | state: {
10 | token: '',
11 | userInfo: null
12 | },
13 | modules: {
14 | side,
15 | menu
16 | },
17 | mutations: {
18 | SET_TOKEN: (state, token) => {
19 | state.token = token
20 | localStorage.setItem('token', token)
21 | },
22 | SET_USER_INFO: (state, userInfo) => {
23 | state.userInfo = userInfo
24 | localStorage.setItem('userInfo', JSON.stringify(userInfo))
25 | },
26 | clearData: (state) => {
27 | state.token = null
28 | }
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/front/src/store/menu.js:
--------------------------------------------------------------------------------
1 | export default {
2 | state: {
3 | menuList: [],
4 | authoritys: [],
5 | hasRoute: false,
6 | menus: []
7 | },
8 | mutations: {
9 | setMenuList(state, menuList) {
10 | state.menuList = menuList
11 | let temp = []
12 | menuList.forEach(menu => {
13 | let parentTitle = menu.title
14 | if (menu.children !== null || menu.children !== ''){
15 | menu.children.forEach(child => {
16 | if (child.path !== '' && child.path !== null){
17 | temp.push({
18 | name: child.name,
19 | title: child.title,
20 | path: child.path,
21 | parentTitle: parentTitle
22 | })
23 | }
24 | })
25 | }
26 | })
27 | state.menus = temp
28 | },
29 | setAuthoritys(state, authoritys) {
30 | state.authoritys = authoritys
31 | },
32 | changeRouteStatus(state, hasRoute) {
33 | state.hasRoute = hasRoute
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/front/src/store/side.js:
--------------------------------------------------------------------------------
1 | export default {
2 | state: {
3 | isCollapse: false,
4 | currentMenu: {
5 | path: '/',
6 | title: '首页',
7 | name: 'home',
8 | parentTitle: "首页"
9 | },
10 | tagsList: [
11 | {
12 | path: '/',
13 | title: '首页',
14 | name: 'index',
15 | parentTitle: "首页"
16 | }
17 | ]
18 | },
19 | mutations: {
20 | collapseMenus(state) {
21 | state.isCollapse = !state.isCollapse;
22 | },
23 | closeTag(state, val){
24 | let result = state.tagsList.findIndex(item => item.name === val.name)
25 | state.tagsList.splice(result, 1)
26 | state.currentMenu = state.tagsList[state.tagsList.length-1]
27 | localStorage.setItem('currentTag', JSON.stringify(state.currentMenu))
28 | },
29 | addTag(state, val){
30 | state.currentMenu = val
31 | let result = state.tagsList.findIndex(item => item.name === val.name)
32 | if (result === -1){
33 | state.tagsList.push(val)
34 | }
35 | localStorage.setItem('currentTag', JSON.stringify(state.currentMenu))
36 | },
37 | home(state){
38 | state.currentMenu = {
39 | path: '/',
40 | title: '首页',
41 | name: 'index',
42 | parentTitle: "首页"
43 | }
44 | localStorage.setItem('currentTag', JSON.stringify(state.currentMenu))
45 | },
46 | selectTag(state, val){
47 | let result = state.tagsList.findIndex(item => item.name === val.name)
48 | val.parentTitle = state.tagsList[result].parentTitle
49 | // val.label !== '首页' ? val.title = val.label : ''
50 | state.currentMenu = val
51 | localStorage.setItem('currentTag', JSON.stringify(state.currentMenu))
52 | },
53 | initTag(state){
54 | state.tagsList = [
55 | {
56 | path: '/',
57 | title: '首页',
58 | name: 'index',
59 | parentTitle: "首页"
60 | }
61 | ]
62 | state.currentMenu = {
63 | path: '/',
64 | title: '首页',
65 | name: 'index',
66 | parentTitle: "首页"
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/front/src/utils/scroll-to.js:
--------------------------------------------------------------------------------
1 | Math.easeInOutQuad = function(t, b, c, d) {
2 | t /= d / 2
3 | if (t < 1) {
4 | return c / 2 * t * t + b
5 | }
6 | t--
7 | return -c / 2 * (t * (t - 2) - 1) + b
8 | }
9 |
10 | // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
11 | var requestAnimFrame = (function() {
12 | return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
13 | })()
14 |
15 | /**
16 | * Because it's so fucking difficult to detect the scrolling element, just move them all
17 | * @param {number} amount
18 | */
19 | function move(amount) {
20 | document.documentElement.scrollTop = amount
21 | document.body.parentNode.scrollTop = amount
22 | document.body.scrollTop = amount
23 | }
24 |
25 | function position() {
26 | return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
27 | }
28 |
29 | /**
30 | * @param {number} to
31 | * @param {number} duration
32 | * @param {Function} callback
33 | */
34 | export function scrollTo(to, duration, callback) {
35 | const start = position()
36 | const change = to - start
37 | const increment = 20
38 | let currentTime = 0
39 | duration = (typeof (duration) === 'undefined') ? 500 : duration
40 | var animateScroll = function() {
41 | // increment the time
42 | currentTime += increment
43 | // find the value with the quadratic in-out easing function
44 | var val = Math.easeInOutQuad(currentTime, start, change, duration)
45 | // move the document.body
46 | move(val)
47 | // do the animation unless its over
48 | if (currentTime < duration) {
49 | requestAnimFrame(animateScroll)
50 | } else {
51 | if (callback && typeof (callback) === 'function') {
52 | // the animation is done so lets callback
53 | callback()
54 | }
55 | }
56 | }
57 | animateScroll()
58 | }
59 |
--------------------------------------------------------------------------------
/front/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
31 |
32 |
64 |
--------------------------------------------------------------------------------
/front/src/views/good/Bar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
73 |
74 |
77 |
--------------------------------------------------------------------------------
/front/src/views/good/Pie.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
76 |
--------------------------------------------------------------------------------
/front/src/views/monitor/Druid.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
--------------------------------------------------------------------------------
/front/src/views/monitor/Swagger.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/SystemAdminJavaApplication.java:
--------------------------------------------------------------------------------
1 | package com.fanchen;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class SystemAdminJavaApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(SystemAdminJavaApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/annotation/Log.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.annotation;
2 |
3 | import java.lang.annotation.*;
4 |
5 | @Target({ ElementType.PARAMETER, ElementType.METHOD })
6 | @Retention(RetentionPolicy.RUNTIME)
7 | @Documented
8 | public @interface Log {
9 | /**
10 | * 模块
11 | */
12 | String title() default "";
13 |
14 | /**
15 | * 功能
16 | */
17 | String businessType() default "";
18 |
19 | /**
20 | * 是否保存请求的参数
21 | */
22 | boolean isSaveRequestData() default true;
23 |
24 | /**
25 | * 是否保存响应的参数
26 | */
27 | boolean isSaveResponseData() default true;
28 | }
29 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/dto/GoodDto.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.dto;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * @author fanchen
7 | * @date 2021/12/11
8 | * @time 18:07
9 | */
10 | @Data
11 | public class GoodDto {
12 | private Long id;
13 | private String goodName;
14 | private Integer goodNum;
15 | private String goodSize;
16 | }
17 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/dto/NavMenu.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | @Data
10 | public class NavMenu implements Serializable {
11 | private Long id;
12 | private String name;
13 | private String title;
14 | private String icon;
15 | private String path;
16 | private String component;
17 | private Integer orderNum;
18 | private List children = new ArrayList<>();
19 | }
20 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/exception/CaptchaException.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.exception;
2 |
3 | import org.springframework.security.core.AuthenticationException;
4 |
5 | public class CaptchaException extends AuthenticationException {
6 | public CaptchaException(String msg) {
7 | super(msg);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/exception/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.exception;
2 |
3 | import com.fanchen.common.lang.Result;
4 | import org.springframework.dao.DuplicateKeyException;
5 | import org.springframework.http.HttpStatus;
6 | import org.springframework.validation.BindingResult;
7 | import org.springframework.validation.ObjectError;
8 | import org.springframework.web.bind.MethodArgumentNotValidException;
9 | import org.springframework.web.bind.annotation.ExceptionHandler;
10 | import org.springframework.web.bind.annotation.ResponseStatus;
11 | import org.springframework.web.bind.annotation.RestControllerAdvice;
12 |
13 | import java.util.Optional;
14 |
15 | /**
16 | * 全局异常处理
17 | */
18 | @RestControllerAdvice
19 | public class GlobalExceptionHandler {
20 | // 实体校验异常捕获
21 | @ResponseStatus(HttpStatus.BAD_REQUEST)
22 | @ExceptionHandler(value = MethodArgumentNotValidException.class)
23 | public Result handler(MethodArgumentNotValidException e) {
24 | BindingResult result = e.getBindingResult();
25 | Optional first = result.getAllErrors().stream().findFirst();
26 | return first.map(objectError -> Result.fail(objectError.getDefaultMessage())
27 | ).orElseGet(
28 | () -> Result.fail("参数不合法")
29 | );
30 | }
31 |
32 | // 不合法的参数异常
33 | @ResponseStatus(HttpStatus.BAD_REQUEST)
34 | @ExceptionHandler(value = IllegalArgumentException.class)
35 | public Result handler(IllegalArgumentException e) {
36 | return Result.fail(e.getMessage());
37 | }
38 |
39 | @ResponseStatus(HttpStatus.BAD_REQUEST)
40 | @ExceptionHandler(value = DuplicateKeyException.class)
41 | public Result handler(DuplicateKeyException e){
42 | e.printStackTrace();
43 | return Result.fail("操作失败,不可以重复添加");
44 | }
45 |
46 | // 运行时异常
47 | @ResponseStatus(HttpStatus.BAD_REQUEST)
48 | @ExceptionHandler(value = RuntimeException.class)
49 | public Result handler(RuntimeException e) {
50 | return Result.fail(e.getMessage());
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/lang/Const.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.lang;
2 |
3 | public class Const {
4 | public final static String CAPTCHA_KEY = "captcha";
5 | public final static String DEFAULT_PASSWORD = "666666";
6 | public final static String IMG_PATH = "http://localhost:8081/img";
7 | public final static String DEFAULT_IMG = "http://localhost:8081/img/2021/12/400bba2995ec46fc97249cece09f9ca4.jpg";
8 | public final static int ROLE_STUDENT = 2;
9 | public final static int ROLE_TEACHER = 1;
10 | public final static int ROLE_SERVICE = 0;
11 | public final static String HISTORY_DAY_LIST = "ChinaDayList";
12 | public final static String NOTICE_KEY = "SystemNotice";
13 | public final static String VaccineTopData = "VaccineTopData";
14 | public final static String ChinaVaccineTrendData = "ChinaVaccineTrendData";
15 | public final static String ChinaData = "ChinaData";
16 | }
17 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/common/lang/Result.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.common.lang;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * 返回结果封装
7 | */
8 | @Data
9 | public class Result {
10 | private int code;// 200是正常,非200表示异常
11 | private String msg;
12 | private Object data;
13 |
14 | public static Result succ(Object data) {
15 | return succ(200, "操作成功", data);
16 | }
17 |
18 | public static Result succ(int code, String msg, Object data) {
19 | Result r = new Result();
20 | r.setCode(code);
21 | r.setMsg(msg);
22 | r.setData(data);
23 | return r;
24 | }
25 |
26 | public static Result fail(String msg) {
27 | return fail(400, msg, null);
28 | }
29 |
30 | public static Result fail(int code, String msg, Object data) {
31 | Result r = new Result();
32 | r.setCode(code);
33 | r.setMsg(msg);
34 | r.setData(data);
35 | return r;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/config/ApplicationConfig.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6 |
7 | @Configuration
8 | public class ApplicationConfig implements WebMvcConfigurer {
9 | @Override
10 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
11 | registry.addResourceHandler("/img/**").addResourceLocations("file:D:/upload/");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/config/CorsConfig.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.cors.CorsConfiguration;
6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7 | import org.springframework.web.filter.CorsFilter;
8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9 |
10 | @Configuration
11 | public class CorsConfig implements WebMvcConfigurer {
12 |
13 | @Bean
14 | public CorsFilter corsFilter(){
15 | // 1. 添加cors配置信息
16 | CorsConfiguration config = new CorsConfiguration();
17 | // Response Headers里面的Access-Control-Allow-Origin: http://localhost:8080
18 | config.addAllowedOrigin("http://localhost:8080");
19 | // 其实不建议使用*,允许所有跨域
20 | //config.addAllowedOrigin("*");
21 | // 设置是否发送cookie信息,在前端也可以设置axios.defaults.withCredentials = true;表示发送Cookie,
22 | // 跨域请求要想带上cookie,必须要请求属性withCredentials=true,这是浏览器的同源策略导致的问题:不允许JS访问跨域的Cookie
23 | /**
24 | * withCredentials前后端都要设置,后端是setAllowCredentials来设置
25 | * 如果后端设置为false而前端设置为true,前端带cookie就会报错
26 | * 如果后端为true,前端为false,那么后端拿不到前端的cookie,cookie数组为null
27 | * 前后端都设置withCredentials为true,表示允许前端传递cookie到后端。
28 | * 前后端都为false,前端不会传递cookie到服务端,后端也不接受cookie
29 | */
30 | // Response Headers里面的Access-Control-Allow-Credentials: true
31 | config.setAllowCredentials(false);
32 | // 设置允许请求的方式,比如get、post、put、delete,*表示全部
33 | // Response Headers里面的Access-Control-Allow-Methods属性
34 | config.addAllowedMethod("*");
35 | // 设置允许的header
36 | // Response Headers里面的Access-Control-Allow-Headers属性,这里是Access-Control-Allow-Headers: content-type, headeruserid, headerusertoken
37 | config.addAllowedHeader("*");
38 | // Response Headers里面的Access-Control-Max-Age:3600
39 | // 表示下回同一个接口post请求,在3600s之内不会发送options请求,不管post请求成功还是失败,3600s之内不会再发送options请求
40 | // 如果不设置这个,那么每次post请求之前必定有options请求
41 | // 当前跨域请求最大有效时长。这里默认1天
42 | long maxAge = 24 * 60 * 60;
43 | config.setMaxAge(maxAge);
44 | config.addExposedHeader("Authorization");
45 | // 2. 为url添加映射路径
46 | UrlBasedCorsConfigurationSource corsSource = new UrlBasedCorsConfigurationSource();
47 | // /**表示该config适用于所有路由
48 | corsSource.registerCorsConfiguration("/**", config);
49 | // 3. 返回重新定义好的corsSource
50 | return new CorsFilter(corsSource);
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/config/KaptchaConfig.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.config;
2 |
3 | import com.google.code.kaptcha.impl.DefaultKaptcha;
4 | import com.google.code.kaptcha.util.Config;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | import java.util.Properties;
9 |
10 | @Configuration
11 | public class KaptchaConfig {
12 | @Bean
13 | public DefaultKaptcha producer(){
14 | Properties properties = new Properties();
15 | properties.put("kaptcha.border", "no");
16 | properties.put("kaptcha.textproducer.font.color", "black");
17 | properties.put("kaptcha.textproducer.char.space", "4");
18 | properties.put("kaptcha.image.height", "42");
19 | properties.put("kaptcha.image.width", "162");
20 | properties.put("kaptcha.textproducer.font.size", "30");
21 | Config config = new Config(properties);
22 | DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
23 | defaultKaptcha.setConfig(config);
24 | return defaultKaptcha;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/config/MyBatisPlusConfig.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.config;
2 |
3 | import com.baomidou.mybatisplus.annotation.DbType;
4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
5 | import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
6 | import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
7 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
8 | import org.mybatis.spring.annotation.MapperScan;
9 | import org.springframework.context.annotation.Bean;
10 | import org.springframework.context.annotation.Configuration;
11 | import org.springframework.transaction.annotation.EnableTransactionManagement;
12 |
13 | @Configuration
14 | @MapperScan("com.fanchen.mapper")
15 | @EnableTransactionManagement
16 | public class MyBatisPlusConfig {
17 | @Bean
18 | public MybatisPlusInterceptor mybatisPlusInterceptor(){
19 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
20 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));//分页插件
21 | interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());//乐观锁
22 | interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());//防止全表更新
23 | return interceptor;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.config;
2 |
3 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
4 | import com.fasterxml.jackson.annotation.PropertyAccessor;
5 | import com.fasterxml.jackson.databind.ObjectMapper;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.data.redis.connection.RedisConnectionFactory;
9 | import org.springframework.data.redis.core.RedisTemplate;
10 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
11 | import org.springframework.data.redis.serializer.StringRedisSerializer;
12 |
13 | @Configuration
14 | public class RedisConfig {
15 |
16 | @Bean
17 | @SuppressWarnings("all")
18 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) {
19 | RedisTemplate template = new RedisTemplate<>();
20 | template.setConnectionFactory(factory);
21 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
22 | ObjectMapper om = new ObjectMapper();
23 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
24 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
25 | jackson2JsonRedisSerializer.setObjectMapper(om);
26 | StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
27 | // key采用String的序列化方式
28 | template.setKeySerializer(stringRedisSerializer);
29 | // hash的key也采用String的序列化方式
30 | template.setHashKeySerializer(stringRedisSerializer);
31 | // value序列化方式采用jackson
32 | template.setValueSerializer(jackson2JsonRedisSerializer);
33 | // hash的value序列化方式采用jackson
34 | template.setHashValueSerializer(jackson2JsonRedisSerializer);
35 | template.afterPropertiesSet();
36 |
37 | return template;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/AccessRegisterController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 |
4 | import cn.hutool.core.date.DateTime;
5 | import cn.hutool.core.date.DateUtil;
6 | import cn.hutool.core.util.StrUtil;
7 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
8 | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
10 | import com.fanchen.annotation.Log;
11 | import com.fanchen.common.lang.Result;
12 | import com.fanchen.entity.AccessRegister;
13 | import org.springframework.security.access.prepost.PreAuthorize;
14 | import org.springframework.validation.annotation.Validated;
15 | import org.springframework.web.bind.annotation.*;
16 |
17 | import java.security.Principal;
18 |
19 | /**
20 | *
21 | * 出入登记表 前端控制器
22 | *
23 | *
24 | * @author fanchen
25 | * @since 2021-12-17
26 | */
27 | @RestController
28 | @RequestMapping("/access/register")
29 | public class AccessRegisterController extends BaseController {
30 |
31 | @PostMapping
32 | @Log(title = "出入登记", businessType = "添加记录")
33 | @PreAuthorize("hasAnyAuthority('access:register:save')")
34 | public Result save(@Validated @RequestBody AccessRegister accessRegister, Principal principal){
35 | accessRegister.setCreateBy(principal.getName());
36 | boolean flag = accessRegisterService.addRegister(accessRegister);
37 | return flag ? Result.succ("登记成功") : Result.fail("登记失败");
38 | }
39 |
40 | @GetMapping("/list")
41 | @PreAuthorize("hasAnyAuthority('access:register:list')")
42 | public Result list(String name, Integer type, String start, String end){
43 | LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(AccessRegister.class);
44 | wrapper.like(StrUtil.isNotBlank(name), AccessRegister::getName, name);
45 | wrapper.eq(type != null, AccessRegister::getType, type);
46 | if (StrUtil.isNotBlank(start) && StrUtil.isNotBlank(end)){
47 | DateTime a = DateUtil.parse(start + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
48 | DateTime b = DateUtil.parse(end + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
49 | wrapper.between(AccessRegister::getCreateTime, a, b);
50 | }
51 | wrapper.orderByDesc(AccessRegister::getCreateTime);
52 | Page page = accessRegisterService.page(getPage(), wrapper);
53 | return Result.succ(page);
54 | }
55 |
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/AccessReturnController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 |
4 | import cn.hutool.core.date.DateTime;
5 | import cn.hutool.core.date.DateUtil;
6 | import cn.hutool.core.util.StrUtil;
7 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
8 | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
10 | import com.fanchen.common.lang.Result;
11 | import com.fanchen.entity.AccessReturn;
12 | import org.springframework.security.access.prepost.PreAuthorize;
13 | import org.springframework.web.bind.annotation.GetMapping;
14 | import org.springframework.web.bind.annotation.RequestMapping;
15 | import org.springframework.web.bind.annotation.RestController;
16 |
17 | /**
18 | *
19 | * 未归用户表 前端控制器
20 | *
21 | *
22 | * @author fanchen
23 | * @since 2021-12-17
24 | */
25 | @RestController
26 | @RequestMapping("/access/return")
27 | public class AccessReturnController extends BaseController {
28 |
29 | @GetMapping("/list")
30 | @PreAuthorize("hasAnyAuthority('access:return:list')")
31 | public Result list(String name, String dept, String start, String end){
32 | LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(AccessReturn.class);
33 | wrapper.like(StrUtil.isNotBlank(name), AccessReturn::getName, name);
34 | wrapper.like(StrUtil.isNotBlank(dept), AccessReturn::getDept, dept);
35 | if (StrUtil.isNotBlank(start) && StrUtil.isNotBlank(end)){
36 | DateTime a = DateUtil.parse(start + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
37 | DateTime b = DateUtil.parse(end + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
38 | wrapper.between(AccessReturn::getCreateTime, a, b);
39 | }
40 | wrapper.orderByDesc(AccessReturn::getCreateTime);
41 | Page page = accessReturnService.page(getPage(), wrapper);
42 | return Result.succ(page);
43 | }
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/BaseController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 | import com.fanchen.service.*;
5 | import com.fanchen.utils.RedisUtil;
6 | import org.springframework.web.bind.ServletRequestUtils;
7 |
8 | import javax.annotation.Resource;
9 | import javax.servlet.http.HttpServletRequest;
10 |
11 | public class BaseController {
12 |
13 | @Resource
14 | HttpServletRequest request;
15 |
16 | @Resource
17 | RedisUtil redisUtil;
18 |
19 | @Resource
20 | SysUserService sysUserService;
21 |
22 | @Resource
23 | SysMenuService sysMenuService;
24 |
25 | @Resource
26 | SysRoleService sysRoleService;
27 |
28 | @Resource
29 | SysRoleMenuService sysRoleMenuService;
30 |
31 | @Resource
32 | SysUserRoleService sysUserRoleService;
33 |
34 | @Resource
35 | SysDeptService sysDeptService;
36 |
37 | @Resource
38 | SysLoginInfoService sysLoginInfoService;
39 |
40 | @Resource
41 | SysOperateLogService sysOperateLogService;
42 |
43 | @Resource
44 | GoodTypeService goodTypeService;
45 |
46 | @Resource
47 | GoodInfoService goodInfoService;
48 |
49 | @Resource
50 | GoodStockService goodStockService;
51 |
52 | @Resource
53 | HealthClockService healthClockService;
54 |
55 | @Resource
56 | HealthReportService healthReportService;
57 |
58 | @Resource
59 | AccessRegisterService accessRegisterService;
60 |
61 | @Resource
62 | AccessReturnService accessReturnService;
63 |
64 | @Resource
65 | LeaveApplyService leaveApplyService;
66 |
67 | @Resource
68 | SysNoticeService sysNoticeService;
69 |
70 | public Page getPage(){
71 | int pageNum = ServletRequestUtils.getIntParameter(request, "pageNum", 1);
72 | int pageSize = ServletRequestUtils.getIntParameter(request, "pageSize", 10);
73 | return new Page(pageNum, pageSize);
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/GoodTypeController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 |
4 | import cn.hutool.core.util.StrUtil;
5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 | import com.fanchen.annotation.Log;
8 | import com.fanchen.common.lang.Result;
9 | import com.fanchen.entity.GoodType;
10 | import org.springframework.security.access.prepost.PreAuthorize;
11 | import org.springframework.validation.annotation.Validated;
12 | import org.springframework.web.bind.annotation.*;
13 |
14 | import java.security.Principal;
15 | import java.util.Arrays;
16 | import java.util.List;
17 |
18 | /**
19 | *
20 | * 物资类型表 前端控制器
21 | *
22 | *
23 | * @author fanchen
24 | * @since 2021-12-09
25 | */
26 | @RestController
27 | @RequestMapping("/good/type")
28 | public class GoodTypeController extends BaseController {
29 |
30 | @GetMapping
31 | @PreAuthorize("hasAnyAuthority('good:type:list')")
32 | public Result simpleList(){
33 | QueryWrapper wrapper = new QueryWrapper<>();
34 | wrapper.eq("status", 1);
35 | wrapper.select("id", "type");
36 | wrapper.orderByAsc("order_num");
37 | List list = goodTypeService.list(wrapper);
38 | return Result.succ(list);
39 | }
40 |
41 | @GetMapping("/list")
42 | @PreAuthorize("hasAnyAuthority('good:type:list')")
43 | public Result list(String type, String createBy, Integer status) {
44 | QueryWrapper wrapper = new QueryWrapper<>();
45 | wrapper.like(StrUtil.isNotBlank(type), "type", type);
46 | wrapper.like(StrUtil.isNotBlank(createBy), "create_by", createBy);
47 | wrapper.eq(status != null, "status", status);
48 | wrapper.orderByAsc("order_num");
49 | Page page = goodTypeService.page(getPage(), wrapper);
50 | return Result.succ(page);
51 | }
52 |
53 | @PostMapping
54 | @Log(title = "物资类型", businessType = "添加类型")
55 | @PreAuthorize("hasAnyAuthority('good:type:save')")
56 | public Result save(@Validated @RequestBody GoodType goodType, Principal principal) {
57 | goodType.setCreateBy(principal.getName());
58 | boolean save = goodTypeService.save(goodType);
59 | if (save) {
60 | return Result.succ("添加类型成功!");
61 | } else {
62 | return Result.fail("添加类型失败!");
63 | }
64 | }
65 |
66 | @PutMapping
67 | @Log(title = "物资类型", businessType = "更新类型")
68 | @PreAuthorize("hasAnyAuthority('good:type:update')")
69 | public Result update(@Validated @RequestBody GoodType goodType, Principal principal) {
70 | goodType.setCreateBy(principal.getName());
71 | boolean update = goodTypeService.updateById(goodType);
72 | if (update) {
73 | return Result.succ("修改类型成功!");
74 | } else {
75 | return Result.fail("修改类型失败!");
76 | }
77 | }
78 |
79 | @DeleteMapping
80 | @Log(title = "物资类型", businessType = "删除类型")
81 | @PreAuthorize("hasAnyAuthority('good:type:delete')")
82 | public Result delete(Long[] ids) {
83 | boolean remove = goodTypeService.removeByIds(Arrays.asList(ids));
84 | if (remove) {
85 | return Result.succ("删除类型成功!");
86 | } else {
87 | return Result.fail("删除类型失败!");
88 | }
89 | }
90 |
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/HealthClockController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 |
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 | import com.fanchen.annotation.Log;
7 | import com.fanchen.common.lang.Result;
8 | import com.fanchen.entity.HealthClock;
9 | import com.fanchen.entity.SysUser;
10 | import com.fanchen.entity.SysUserRole;
11 | import org.springframework.beans.factory.annotation.Value;
12 | import org.springframework.security.access.prepost.PreAuthorize;
13 | import org.springframework.validation.annotation.Validated;
14 | import org.springframework.web.bind.annotation.*;
15 |
16 | import java.security.Principal;
17 | import java.util.List;
18 |
19 | /**
20 | *
21 | * 打卡健康表 前端控制器
22 | *
23 | *
24 | * @author fanchen
25 | * @since 2021-12-15
26 | */
27 | @RestController
28 | @RequestMapping("/health/clock")
29 | public class HealthClockController extends BaseController {
30 |
31 | @Value("${system.code.teacherRole}")
32 | private Long teacherRole;
33 |
34 | @GetMapping("/list")
35 | @PreAuthorize("hasAnyAuthority('health:clock:list')")
36 | public Result list(Integer healthType, Integer middleHigh, Integer diagnosis, Integer returnInfo, Long deptId, Principal principal){
37 | String username = principal.getName();
38 | SysUser sysUser = (SysUser) redisUtil.get("User:" + username);
39 | List sysUserRoles = sysUserRoleService.list(new QueryWrapper().eq("user_id", sysUser.getId()));
40 | boolean flag = false;
41 | for (SysUserRole userRole : sysUserRoles) {
42 | if (userRole.getRoleId().equals(teacherRole)) {
43 | flag = true;
44 | break;
45 | }
46 | }
47 | QueryWrapper wrapper = new QueryWrapper<>();
48 | if (flag){
49 | wrapper.eq(healthType != null, "health_type", healthType);
50 | wrapper.eq(middleHigh != null, "middle_high", middleHigh);
51 | wrapper.eq(diagnosis != null, "diagnosis", diagnosis);
52 | wrapper.eq(returnInfo != null, "return_info", returnInfo);
53 | wrapper.eq(deptId != null, "dept_id", deptId);
54 | }else {
55 | wrapper.eq("username", username);
56 | }
57 | wrapper.orderByDesc("create_time");
58 | Page page = healthClockService.page(getPage(), wrapper);
59 | return Result.succ(page);
60 | }
61 |
62 | @GetMapping
63 | public Result check(Principal principal){
64 | String name = principal.getName();
65 | int count = healthClockService.checkClockToday(name);
66 | return count > 0 ? Result.succ("今日已打卡,请不要重复打卡!") : Result.succ("allow");
67 | }
68 |
69 | @PostMapping
70 | @Log(title = "健康打卡", businessType = "添加打卡")
71 | @PreAuthorize("hasAnyAuthority('health:clock:save')")
72 | public Result save(@Validated @RequestBody HealthClock healthClock){
73 | boolean save = healthClockService.save(healthClock);
74 | if (save){
75 | return Result.succ("打卡成功");
76 | }else {
77 | return Result.fail("打卡失败");
78 | }
79 | }
80 |
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/KaptchaController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 | import cn.hutool.core.map.MapUtil;
4 | import cn.hutool.core.util.StrUtil;
5 | import com.fanchen.common.lang.Const;
6 | import com.fanchen.common.lang.Result;
7 | import com.fanchen.entity.SysDept;
8 | import com.fanchen.entity.SysUser;
9 | import com.fanchen.utils.UploadUtil;
10 | import com.google.code.kaptcha.Producer;
11 | import org.springframework.web.bind.annotation.GetMapping;
12 | import org.springframework.web.bind.annotation.PostMapping;
13 | import org.springframework.web.bind.annotation.RestController;
14 | import org.springframework.web.multipart.MultipartFile;
15 | import sun.misc.BASE64Encoder;
16 |
17 | import javax.annotation.Resource;
18 | import javax.imageio.ImageIO;
19 | import java.awt.image.BufferedImage;
20 | import java.io.ByteArrayOutputStream;
21 | import java.io.IOException;
22 | import java.security.Principal;
23 | import java.util.HashMap;
24 | import java.util.Map;
25 | import java.util.UUID;
26 |
27 | /**
28 | * @author fanchen
29 | */
30 | @RestController
31 | public class KaptchaController extends BaseController {
32 |
33 | @Resource
34 | private Producer producer;
35 |
36 | @GetMapping("/captcha")
37 | public Result captcha() {
38 | String key = UUID.randomUUID().toString().replace("-", "");
39 | String code = producer.createText();
40 | BufferedImage image = producer.createImage(code);
41 | ByteArrayOutputStream os = new ByteArrayOutputStream();
42 | try {
43 | ImageIO.write(image, "jpg", os);
44 | } catch (IOException e) {
45 | e.printStackTrace();
46 | }
47 | BASE64Encoder encoder = new BASE64Encoder();
48 | String str = "data:image/jpeg;base64,";
49 | String img = str + encoder.encode(os.toByteArray());
50 | redisUtil.hset(Const.CAPTCHA_KEY, key, code, 60);
51 | return Result.succ(
52 | MapUtil.builder().put("base64", img).put("key", key).build()
53 | );
54 | }
55 |
56 | @GetMapping("/userInfo")
57 | public Result userInfo(Principal principal){
58 | SysUser sysUser = (SysUser) redisUtil.get("User:" + principal.getName());
59 | sysUser.setPassword("");
60 | SysDept sysDept;
61 | if (redisUtil.hasKey("DeptId:" + sysUser.getDeptId())){
62 | sysDept = (SysDept) redisUtil.get("DeptId:" + sysUser.getDeptId());
63 | }else {
64 | sysDept = sysDeptService.getById(sysUser.getDeptId());
65 | redisUtil.set("DeptId:" + sysUser.getDeptId(), sysDept, 3660);
66 | }
67 | Map map = new HashMap<>();
68 | map.put("user", sysUser);
69 | map.put("dept", sysDept);
70 | return Result.succ(map);
71 | }
72 |
73 | @PostMapping("/upload")
74 | public Result upload(MultipartFile file){
75 | if (!file.isEmpty()){
76 | String uploadImg = UploadUtil.uploadImg(file);
77 | if (StrUtil.isEmpty(uploadImg)) {
78 | return Result.fail("图片上传失败");
79 | }
80 | return Result.succ(Const.IMG_PATH + uploadImg);
81 | }
82 | return Result.fail("图片上传失败!");
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/server/src/main/java/com/fanchen/controller/RedisController.java:
--------------------------------------------------------------------------------
1 | package com.fanchen.controller;
2 |
3 | import com.fanchen.common.lang.Result;
4 | import org.apache.commons.lang3.StringUtils;
5 | import org.springframework.data.redis.connection.RedisServerCommands;
6 | import org.springframework.data.redis.core.RedisCallback;
7 | import org.springframework.data.redis.core.RedisTemplate;
8 | import org.springframework.web.bind.annotation.GetMapping;
9 | import org.springframework.web.bind.annotation.RestController;
10 |
11 | import javax.annotation.Resource;
12 | import java.util.*;
13 |
14 | /**
15 | * @author fanchen
16 | * @date 2021/12/25
17 | * @time 15:56
18 | */
19 | @RestController
20 | public class RedisController {
21 |
22 | @Resource
23 | private RedisTemplate redisTemplate;
24 |
25 | @GetMapping("/monitor/redis")
26 | public Result redis(){
27 | Properties info = (Properties) redisTemplate.execute((RedisCallback