基于javaweb和mysql的springboot大创管理系统(java+springboot+mybaits+vue+elementui+mysql)

私信源码获取及调试交流

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行

前端:WebStorm/VSCode/HBuilderX等均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的SpringBoot大创管理系统(java+springboot+mybaits+vue+elementui+mysql)

项目介绍

基于springboot的大创管理系统

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits

前端:Vue + elementui

使用说明

项目运行:

  1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;

  3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

  4. 运行项目,在浏览器中输入地址:

前台地址:http://localhost:8080/springbootrpj39/front/index.html

后台地址:http://localhost:8080/springbootrpj39/admin/dist/index.html

管理员 abo 密码 abo

用户:用户1 密码: 123456

注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。


*/

@GetMapping("/add")

public String add(ModelMap mmap)

mmap.put("roles", roleService.selectRoleAll());

mmap.put("posts", postService.selectPostAll());

return prefix + "/add";

/**

* 新增保存用户

*/

@RequiresPermissions("system:user:add")

@Log(title = "用户管理", businessType = BusinessType.INSERT)


public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)

mmap.put("role", roleService.selectRoleById(roleId));

return prefix + "/edit";

/**

* 修改保存角色

*/

@RequiresPermissions("system:role:edit")

@Log(title = "角色管理", businessType = BusinessType.UPDATE)

@PostMapping("/edit")

@ResponseBody

public AjaxResult editSave(@Validated SysRole role)

@PostMapping("/authUser/unallocatedList")

@ResponseBody

public TableDataInfo unallocatedList(SysUser user)

startPage();

List<SysUser> list = userService.selectUnallocatedList(user);

return getDataTable(list);

/**

* 批量选择用户授权

*/

@Log(title = "角色管理", businessType = BusinessType.GRANT)

@PostMapping("/authUser/selectAll")

@ResponseBody

public String add(ModelMap mmap)

mmap.put("roles", roleService.selectRoleAll());

mmap.put("posts", postService.selectPostAll());

return prefix + "/add";

/**

* 新增保存用户

*/

@RequiresPermissions("system:user:add")

@Log(title = "用户管理", businessType = BusinessType.INSERT)

@PostMapping("/add")

@ResponseBody

public AjaxResult addSave(@Validated SysUser user)


mmap.put("user", userService.selectUserById(userId));

mmap.put("roles", roleService.selectRolesByUserId(userId));

mmap.put("posts", postService.selectPostsByUserId(userId));

return prefix + "/edit";

/**

* 修改保存用户

*/

@RequiresPermissions("system:user:edit")

@Log(title = "用户管理", businessType = BusinessType.UPDATE)

@PostMapping("/edit")

@ResponseBody

public AjaxResult editSave(@Validated SysUser user)

userService.checkUserAllowed(user);

*/

@Controller

@RequestMapping("/system/role")

public class SysRoleController extends BaseController

private String prefix = "system/role";

@Autowired

private ISysRoleService roleService;

@Autowired

private ISysUserService userService;

@RequiresPermissions("system:role:view")

@GetMapping()

public String role()


ShiroUtils.clearCachedAuthorizationInfo();

return toAjax(roleService.updateRole(role));

/**

* 角色分配数据权限

*/

@GetMapping("/authDataScope/{roleId}")

public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap)

mmap.put("role", roleService.selectRoleById(roleId));

return prefix + "/dataScope";

/**

return "login";

@PostMapping("/login")

@ResponseBody

public AjaxResult ajaxLogin(String username, String password, Boolean rememberMe)

UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe);

Subject subject = SecurityUtils.getSubject();

try

subject.login(token);

return success();

catch (AuthenticationException e)

String msg = "用户或密码错误";

if (StringUtils.isNotEmpty(e.getMessage()))


return error();

@RequiresPermissions("system:role:remove")

@Log(title = "角色管理", businessType = BusinessType.DELETE)

@PostMapping("/remove")

@ResponseBody

public AjaxResult remove(String ids)

try

return toAjax(roleService.deleteRoleByIds(ids));

catch (Exception e)

return error(e.getMessage());

/**

* 校验角色名称


@Log(title = "重置密码", businessType = BusinessType.UPDATE)

@GetMapping("/resetPwd/{userId}")

public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)

mmap.put("user", userService.selectUserById(userId));

return prefix + "/resetPwd";

@RequiresPermissions("system:user:resetPwd")

@Log(title = "重置密码", businessType = BusinessType.UPDATE)

@PostMapping("/resetPwd")

@ResponseBody

public AjaxResult resetPwdSave(SysUser user)

userService.checkUserAllowed(user);

user.setSalt(ShiroUtils.randomSalt());

user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));


@ResponseBody

public AjaxResult changeStatus(SysRole role)

roleService.checkRoleAllowed(role);

return toAjax(roleService.changeStatus(role));

/**

* 分配用户

*/

@RequiresPermissions("system:role:edit")

@GetMapping("/authUser/{roleId}")

public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap)

return success();

return error();

@RequiresPermissions("system:role:remove")

@Log(title = "角色管理", businessType = BusinessType.DELETE)

@PostMapping("/remove")

@ResponseBody

public AjaxResult remove(String ids)

try

return toAjax(roleService.deleteRoleByIds(ids));

catch (Exception e)

return error(e.getMessage());


public AjaxResult authDataScopeSave(SysRole role)

roleService.checkRoleAllowed(role);

role.setUpdateBy(ShiroUtils.getLoginName());

if (roleService.authDataScope(role) > 0)

ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));

return success();

return error();

@RequiresPermissions("system:role:remove")

@Log(title = "角色管理", businessType = BusinessType.DELETE)

@PostMapping("/remove")

* 选择菜单树

*/

@GetMapping("/selectMenuTree")

public String selectMenuTree()

return prefix + "/tree";

/**

* 角色状态修改

*/

@Log(title = "角色管理", businessType = BusinessType.UPDATE)

@RequiresPermissions("system:role:edit")

@PostMapping("/changeStatus")

@ResponseBody

public AjaxResult changeStatus(SysRole role)


/**

* 分配用户

*/

@RequiresPermissions("system:role:edit")

@GetMapping("/authUser/{roleId}")

public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap)

mmap.put("role", roleService.selectRoleById(roleId));

return prefix + "/authUser";

/**

* 查询已分配用户角色列表

*/

@RequiresPermissions("system:role:list")


ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));

return success();

return error();

@RequiresPermissions("system:user:remove")

@Log(title = "用户管理", businessType = BusinessType.DELETE)

@PostMapping("/remove")

@ResponseBody

public AjaxResult remove(String ids)

try

return toAjax(userService.deleteUserByIds(ids));

catch (Exception e)


@RequiresPermissions("system:role:list")

@PostMapping("/list")

@ResponseBody

public TableDataInfo list(SysRole role)

startPage();

List<SysRole> list = roleService.selectRoleList(role);

return getDataTable(list);

@Log(title = "角色管理", businessType = BusinessType.EXPORT)

@RequiresPermissions("system:role:export")

@PostMapping("/export")

@ResponseBody

public AjaxResult export(SysRole role)


List<SysUser> userList = util.importExcel(file.getInputStream());

String operName = ShiroUtils.getSysUser().getLoginName();

String message = userService.importUser(userList, updateSupport, operName);

return AjaxResult.success(message);

@RequiresPermissions("system:user:view")

@GetMapping("/importTemplate")

@ResponseBody

public AjaxResult importTemplate()

ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);

return util.importTemplateExcel("用户数据");

/**

* 新增用户

*/

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐