——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明

















基于javaweb的SpringBoot前后端分离疫情防疫平台设计和实现(java+springmvc+vue+node.js+mybatis+mysql+springboot+maven)
主要技术:Java、springmvc、VUE、node.js、mybatis、mysql、jquery、layui、bootstarp、JavaScript、html、css、jsp、log4j等一些常见的基本技术。 主要模块功能有:
管理员用户登录:用户登录。
用户信息: 用户信息数据的列表查看、修改和删除、用户绑定角色来显示对应的菜单显示。
角色管理:角色信息数据的列表查看、修改和删除、每个角色可以设置不同菜单显示、超级管理员拥有最高权限。
菜单管理: 菜单信息数据的列表查看、修改和删除、可以通过用户角色来设置
菜单权限:根据用户绑定角色、角色绑定菜单显示、以及基础菜单的添加、修改和删除操作。
实时疫情状态:通过echarts图标来模拟实现数据驱动标识、实时显示疫情分布图和感染人员信息等。
历史行程管理:每日登记管理:外出报备管理:复工申请管理:审核信息管理:
通知公告管理:管理员发布一些通知公告信息以及管理查看等
这个系统主要功能截图如下:
登录之后进入系统首页:目前系统主要功能如下
用户管理模块:用户添加、修改、删除、查询等基本操作
角色管理模块、通过用户绑定角色、角色控制菜单显示、灵活控制菜单。
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
@SysLog("修改角色") @PostMapping("/update") @RequiresPermissions("sys:role:update") public R update(@RequestBody SysRoleEntity role){ ValidatorUtils.validateEntity(role); role.setCreateUserId(getUserId()); sysRoleService.update(role); return R.ok(); }
@SysLog("删除角色") @PostMapping("/delete") @RequiresPermissions("sys:role:delete") public R delete(@RequestBody Long[] roleIds){ sysRoleService.deleteBatch(roleIds); return R.ok(); } }
package io.renren.modules.sys.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| @ApiOperation("登录") public R login(@RequestBody LoginForm form){ ValidatorUtils.validateEntity(form);
long userId = userService.login(form);
String token = jwtUtils.generateToken(userId);
Map<String, Object> map = new HashMap<>(); map.put("token", token); map.put("expire", jwtUtils.getExpire());
return R.ok(map); }
}
package io.renren.modules.sys.controller;
@RestController @RequestMapping("/sys/toworkApply") public class ToworkApplyController extends AbstractController { @Autowired private ToworkApplyService ToworkApplyService;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| * 保存云存储配置信息 */ @PostMapping("/saveConfig") @RequiresPermissions("sys:oss:all") public R saveConfig(@RequestBody CloudStorageConfig config){ ValidatorUtils.validateEntity(config);
if(config.getType() == Constant.CloudService.QINIU.getValue()){ ValidatorUtils.validateEntity(config, QiniuGroup.class); }else if(config.getType() == Constant.CloudService.ALIYUN.getValue()){ ValidatorUtils.validateEntity(config, AliyunGroup.class); }else if(config.getType() == Constant.CloudService.QCLOUD.getValue()){ ValidatorUtils.validateEntity(config, QcloudGroup.class); }
sysConfigService.updateValueByKey(KEY, new Gson().toJson(config));
return R.ok(); }
@PostMapping("/upload") @RequiresPermissions("sys:oss:all") public R upload(@RequestParam("file") MultipartFile file) throws Exception { if (file.isEmpty()) { throw new RRException("上传文件不能为空"); }
String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); String url = OSSFactory.build().uploadSuffix(file.getBytes(), suffix);
SysOssEntity ossEntity = new SysOssEntity();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Object result = point.proceed(); long time = System.currentTimeMillis() - beginTime;
saveSysLog(point, time);
return result; }
private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod();
SysLogEntity sysLog = new SysLogEntity(); SysLog syslog = method.getAnnotation(SysLog.class); if(syslog != null){ sysLog.setOperation(syslog.value()); }
String className = joinPoint.getTarget().getClass().getName(); String methodName = signature.getName(); sysLog.setMethod(className + "." + methodName + "()");
Object[] args = joinPoint.getArgs(); try{ String params = new Gson().toJson(args); sysLog.setParams(params); }catch (Exception e){
}
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); sysLog.setIp(IPUtils.getIpAddr(request));
String username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername(); sysLog.setUsername(username);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| BufferedImage image = sysCaptchaService.getCaptcha(uuid);
ServletOutputStream out = response.getOutputStream(); ImageIO.write(image, "jpg", out); IOUtils.closeQuietly(out); }
@PostMapping("/sys/login") public Map<String, Object> login(@RequestBody SysLoginForm form)throws IOException { boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha());
SysUserEntity user = sysUserService.queryByUserName(form.getUsername());
if(user == null || !user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())) { return R.error("账号或密码不正确"); }
if(user.getStatus() == 0){ return R.error("账号已被锁定,请联系管理员"); }
R r = sysUserTokenService.createToken(user.getUserId()); return r; }
@PostMapping("/sys/logout") public R logout() { sysUserTokenService.logout(getUserId()); return R.ok();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| if(StringUtils.isBlank(token)){ return null; }
return new OAuth2Token(token); }
@Override protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { if(((HttpServletRequest) request).getMethod().equals(RequestMethod.OPTIONS.name())){ return true; }
return false; }
@Override protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { String token = getRequestToken((HttpServletRequest) request); if(StringUtils.isBlank(token)){ HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin());
String json = new Gson().toJson(R.error(HttpStatus.SC_UNAUTHORIZED, "invalid token"));
httpResponse.getWriter().print(json);
return false; }
return executeLogin(request, response); }
@Override protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) { HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setContentType("application/json;charset=utf-8"); httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); try { Throwable throwable = e.getCause() == null ? e : e.getCause(); R r = R.error(HttpStatus.SC_UNAUTHORIZED, throwable.getMessage());
String json = new Gson().toJson(r); httpResponse.getWriter().print(json); } catch (IOException e1) {
}
return false;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=471222052008200vp
https://javayms.pages.dev?id=471222052008200vp