Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the front and rear separated information management system based on Java SpringBoot

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve the front and back-end separation information management system based on Java SpringBoot, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

Main function description

User login, change password, home page introduction, data visualization tree view display, user management, menu management, rights control, role management, department management, role management, organizational structure management, system sql monitoring, log management, notification announcement management, important news management, organizational style management, data management, view, upload rich text, etc., and view and download attachment information. Organizational development management, examination management and withdrawal, etc.

Function screenshot

Login: login according to user role permissions, user role flexible control.

System home page:

User management: users' fuzzy query, addition, selection of departments, roles and positions, modification and deletion, etc.

Position management: fuzzy query, addition, access control, modification and deletion of positions.

Menu management: the menu is flexibly controlled by role permissions, specific to the button level

SQL Monitoring:

Aspect log management:

Organizational structure: fuzzy query, addition, access control, modification and deletion of organizational structure

Notification announcement module: fuzzy query, addition, authority control, modification and deletion of notification announcement. And rich text note content

News module:

Organize the style module:

Data management module:

Organizational development module:

Online exam module:

Modify password module

Main code implementation

User login authentication

/ * * login related * * @ author lyy * * / @ RestControllerpublic class SysLoginController extends AbstractController {@ Autowired private SysUserService sysUserService; @ Autowired private SysUserTokenService sysUserTokenService; @ Autowired private SysCaptchaService sysCaptchaService / * * CAPTCHA * / @ GetMapping ("captcha.jpg") public void captcha (HttpServletResponse response, String uuid) throws IOException {response.setHeader ("Cache-Control", "no-store, no-cache"); response.setContentType ("image/jpeg") / / get the image verification code BufferedImage image = sysCaptchaService.getCaptcha (uuid); ServletOutputStream out = response.getOutputStream (); ImageIO.write (image, "jpg", out); IOUtils.closeQuietly (out) } / * Login * / @ PostMapping ("/ sys/login") public Map login (@ RequestBody SysLoginForm form) throws IOException {boolean captcha = sysCaptchaService.validate (form.getUuid (), form.getCaptcha ()); / / if (! captcha) {/ / return R.error ("incorrect verification code") / / user information SysUserEntity user = sysUserService.queryByUserName (form.getUsername ()) / / account does not exist, password error if (user = = null | |! user.getPassword (). Equals (new Sha256Hash (form.getPassword (), user.getSalt ()). ToHex ()) {return R.error ("account or password is incorrect") } / / account lock if (user.getStatus () = = 0) {return R.error ("account is locked, please contact administrator");} / / generate token and save it to database R r = sysUserTokenService.createToken (user.getUserId ()) Return r;} / * * exit * / @ PostMapping ("/ sys/logout") public R logout () {sysUserTokenService.logout (getUserId (); return R.ok ();}

Shiro permission intercept and release:

/ * * Shiro configuration * * @ author lyy * / @ Configurationpublic class ShiroConfig {@ Bean ("securityManager") public SecurityManager securityManager (OAuth3Realm oAuth3Realm) {DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager (); securityManager.setRealm (oAuth3Realm); securityManager.setRememberMeManager (null); return securityManager;} @ Bean ("shiroFilter") public ShiroFilterFactoryBean shiroFilter (SecurityManager securityManager) {ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean (); shiroFilter.setSecurityManager (securityManager) / / oauth filtering Map filters = new HashMap (); filters.put ("oauth3", new OAuth3Filter ()); shiroFilter.setFilters (filters); Map filterMap = new LinkedHashMap (); filterMap.put ("/ webjars/**", "anon"); filterMap.put ("/ druid/**", "anon"); filterMap.put ("/ app/**", "anon") FilterMap.put ("/ sys/login", "anon"); filterMap.put ("/ swagger/**", "anon"); filterMap.put ("/ v2/api-docs", "anon"); filterMap.put ("/ swagger-ui.html", "anon"); filterMap.put ("/ swagger-resources/**", "anon") FilterMap.put ("/ captcha.jpg", "anon"); filterMap.put ("/ aaa.txt", "anon"); filterMap.put ("/ virtuel/**", "anon"); filterMap.put ("/ image/**", "anon"); filterMap.put ("/ *", "oauth3"); shiroFilter.setFilterChainDefinitionMap (filterMap); return shiroFilter @ Bean ("lifecycleBeanPostProcessor") public LifecycleBeanPostProcessor lifecycleBeanPostProcessor () {return new LifecycleBeanPostProcessor ();} @ Bean public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor (SecurityManager securityManager) {AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor (); advisor.setSecurityManager (securityManager); return advisor;}

Front-end vue element login:

Information management system login

Log in to import {getUUID} from'@ / utils' export default {data () {return {dataForm: {userName:', password:'', uuid:', captcha:''} DataRule: {userName: [{required: true, message: 'account cannot be empty', trigger: 'blur'}], password: [{required: true, message:' password cannot be empty', trigger: 'blur'}], captcha: [{required: true Message: 'CAPTCHA cannot be empty', trigger: 'blur'}]}, captchaPath:'}}, created () {this.getCaptcha ()} Methods: {/ / submit form dataFormSubmit () {this.$refs ['dataForm'] .validate ((valid) = > {if (valid) {this.$http ({url: this.$http.adornUrl (' / sys/login'), method: 'post' Data: this.$http.adornData ({'username': this.dataForm.userName,' password': this.dataForm.password, 'uuid': this.dataForm.uuid 'captcha': this.dataForm.captcha})}. Then (({data}) = > {if (data & & data.code = 0) {this.$cookie.set (' token') Data.token) this.$router.replace ({name: 'home'})} else {this.getCaptcha () this.$message.error (data.msg)} / / get the verification code getCaptcha () {this.dataForm.uuid = getUUID () this.captchaPath = this.$http.adornUrl (`/ captcha.jpg?uuid=$ {this.dataForm.uuid}`)}} .site-wrapper.site-page--login {position: absolute Top: 0; right: 0; bottom: 0; left: 0; / / background-color: rgba (38, 50, 56, .6); overflow: hidden; &: before {position: fixed; top: 0; left: 0; z-index:-1; width: 100%; height: 100%; content: "" Background-image: url (~ @ / assets/img/login_bg.jpg); background-size: cover;}. Site-content__wrapper {position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: 0; margin: 0; overflow-x: hidden; overflow-y: auto; background-color: transparent }. Site-content {min-height: 100%; padding: 30px 500px 30px 30px;} .brand-info {margin: 220px 100px 0 90px; color: # fff;}. Brand-info__text {margin: 0 100px 220px 200px; font-size: 100px; font-weight: 400; text-transform: uppercase;}. Brand-info__intro {margin: 10px 0 Font-size: 16px; line-height: 1.58; opacity: .6;}. Login-main {position: absolute; top: 0; right: 0; padding: 150px 60px 180px; width: 470px; min-height: 100%; background-color: # fff;}. Login-title {font-size: 16px }. Login-captcha {overflow: hidden; > img {width: 100%; cursor: pointer;}} .login-btn-submit {width: 100%; margin-top: 38px;}} main data table design

Database table structure document

Database name: renren-dangyuan

Document version: V1.0.0

Document description: database table design description

Table dj_news

Table exam

Table file

Table inform

Table sys_captcha (system verification code)

Table sys_config (system configuration information table)

Table sys_dept (Department Management)

Table sys_log (Syslog)

Table sys_menu (menu Management)

Table sys_oss (file upload)

Table sys_role (roles)

Table sys_role_dept (correspondence between roles and departments)

Table sys_role_menu (role and menu correspondence)

Table sys_user (system users)

Table sys_user_role (correspondence between users and roles)

Table sys_user_token (system user Token)

Table tb_user (user)

Thank you for reading this article carefully. I hope the article "how to implement the front and rear separation information management system based on Java SpringBoot" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report