This is the 25th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”
Preface:
In today’s society, with the development of science and technology, as well as the diversification of market economy, the flow of talents has greatly increased, so it also brings unprecedented and complex challenges to the management of Party building work, so that how to effectively carry out the management of Party building work has become an urgent problem to be solved. Therefore, it is an efficient and achievable method to introduce high-speed information science and technology into the application of party construction work management, strive to reasonably and effectively promote the progress of the overall work, and realize people-oriented scientific development thought and consciousness. Java as a kind of object oriented, can write a cross-platform application software programming language, its technology has excellent versatility, high efficiency, portability and security platform, now has been widely used in PC, data center, game consoles, science super computers, mobile phones and the Internet, etc., greatly convenient people’s life, work and entertainment. And the Party building work management platform based on Java technology, combined with Java technology, so as to standardize the business process of the party and the masses, improve the efficiency of the party and the masses work management, regularly remind the party and the masses work, and timely feedback after the completion of the situation, effectively improve the standardization of the party and the masses work management; Then realize the party and the masses work online information exchange and interactive office, picture data preservation and sharing and other functions.
Video demo:Based on Java-SpringBoot+ VUE front and back end separated Party member information management system mp4
Main Functions
User login, change passwords, page, data visualization tree display, user management, menu management, access control, role management, department of the party branch management, role management party branch, the party branch organization structure management, system SQL monitor, log management, party party construction news announcements, management, management, talent management, party construction data management, view, upload Rich text, etc., and view download attachment information. Organization development management, examination management and exit, etc
Function screenshots:
Login: The user can log in according to the user role permission and flexibly control the user role.
System Home page:
User management: Users can query, add, select departments, roles and positions, modify and delete information
Party construction position management: party construction position fuzzy query, add, authority control and modify and delete
Party construction menu management: menu is flexibly controlled through role permissions, specific to the button level
SQL monitoring:
Section log Management:
Organizational structure of party members: fuzzy inquiry, addition, authority control, modification and deletion of organizational structure of party members
Notice and announcement module: notice and announcement of fuzzy query, add, permission control and modify and delete. And rich text notes content
Party Construction news module:
Organization Style module:
Data Management module:
Organizational Development Module:
Online Exam Modules:
Changing the Password Module
Main code implementation:
User Login Authentication
/** * Login related **@author lyy
*
*/
@RestController
public class SysLoginController extends AbstractController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserTokenService sysUserTokenService;
@Autowired
private SysCaptchaService sysCaptchaService;
/** * Verification code */
@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<String, Object> login(@RequestBody SysLoginForm form)throws IOException {
boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha());
// if(!captcha){
// return r.ror (" Verification code is not correct ");
/ /}
// User information
SysUserEntity user = sysUserService.queryByUserName(form.getUsername());
// The account does not exist or the password is incorrect
if(user == null| |! user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())) {
return R.error("Incorrect account number or password");
}
// The account is locked
if(user.getStatus() == 0) {return R.error("Account has been locked. Please contact your administrator.");
}
// Generate tokens and save them to the database
R r = sysUserTokenService.createToken(user.getUserId());
return r;
}
/** * exit */
@PostMapping("/sys/logout")
public R logout(a) {
sysUserTokenService.logout(getUserId());
return R.ok();
}
Copy the code
Shiro permission blocking release:
/** * Shiro configuration **@author lyy
*/
@Configuration
public class ShiroConfig {
@Bean("securityManager")
public SecurityManager securityManager(OAuth2Realm oAuth2Realm) {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRealm(oAuth2Realm);
securityManager.setRememberMeManager(null);
return securityManager;
}
@Bean("shiroFilter")
public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
shiroFilter.setSecurityManager(securityManager);
/ / request filtering
Map<String, Filter> filters = new HashMap<>();
filters.put("oauth2".new OAuth2Filter());
shiroFilter.setFilters(filters);
Map<String, String> 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("/ * *"."oauth2");
shiroFilter.setFilterChainDefinitionMap(filterMap);
return shiroFilter;
}
@Bean("lifecycleBeanPostProcessor")
public LifecycleBeanPostProcessor lifecycleBeanPostProcessor(a) {
return new LifecycleBeanPostProcessor();
}
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
advisor.setSecurityManager(securityManager);
return advisor;
}
Copy the code
Front-end Vue Element login:
<template>
<div class="site-wrapper site-page--login">
<div class="site-content__wrapper">
<div class="site-content">
<div class="brand-info">
<h1 class="brand-info__text">Party construction information management system</h1>
</div>
<div class="login-main">
<h3 class="login-title">Party building system login</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="Account"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password" type="password" placeholder="Password"></el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="Verification code">
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button class="login-btn-submit" type="danger" @click="dataFormSubmit()">The login</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script>
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 null'.trigger: 'blur'}},captchaPath: ' '
}
},
created () {
this.getCaptcha()
},
methods: {
// Submit the 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=The ${this.dataForm.uuid}`)}}}</script>
<style lang="scss">
.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; }}</style>
Copy the code
Main data table design:
Database table structure document
** Database name: **renren-dangyuan
** Issue: **V1.0.0
** Database table design description
Table dj_news
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | |
2 | title | varchar | 255 | 0 | Y | N | The title |
3 | ty | varchar | 255 | 0 | Y | N | type |
4 | create_time | datetime | 19 | 0 | Y | N | Release time |
5 | unit | varchar | 255 | 0 | Y | N | Release the unit |
6 | num | varchar | 255 | 0 | Y | N | Release number |
7 | content | mediumtext | 16777215 | 0 | Y | N | The main content |
8 | create_by | varchar | 255 | 0 | Y | N | Release people |
9 | bz | varchar | 255 | 0 | Y | N | Note information |
10 | kind | varchar | 255 | 0 | Y | N | Type (Important news of Party Construction and Style of organization) |
11 | img | varchar | 255 | 0 | Y | N |
Table exam
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key |
---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y |
2 | title | varchar | 255 | 0 | Y | N |
3 | answ | varchar | 255 | 0 | Y | N |
4 | user_name | varchar | 255 | 0 | Y | N |
5 | exam_time | datetime | 19 | 0 | Y | N |
6 | user_score | varchar | 255 | 0 | Y | N |
7 | is_qualified | varchar | 255 | 0 | Y | N |
8 | ty | varchar | 255 | 0 | Y | N |
9 | p_name | varchar | 255 | 0 | Y | N |
10 | mobile | varchar | 255 | 0 | Y | N |
Watch the file
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key |
---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y |
2 | path | varchar | 255 | 0 | Y | N |
3 | file_name | varchar | 255 | 0 | Y | N |
4 | file_type | varchar | 255 | 0 | Y | N |
5 | classify | varchar | 255 | 0 | Y | N |
6 | create_time | datetime | 19 | 0 | Y | N |
7 | create_by | varchar | 255 | 0 | Y | N |
Table inform
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | The default value |
---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | |
2 | title | varchar | 255 | 0 | Y | N | |
3 | content | text | 65535 | 0 | Y | N | |
4 | create_time | timestamp | 19 | 0 | Y | N | CURRENT_TIMESTAMP |
5 | create_by | varchar | 255 | 0 | Y | N | |
6 | bz | varchar | 255 | 0 | Y | N |
Table SYS_CAPTCHA (System verification code)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | The default value | instructions |
---|---|---|---|---|---|---|---|---|
1 | uuid | char | 36 | 0 | N | Y | uuid | |
2 | code | varchar | 6 | 0 | N | N | Verification code | |
3 | expire_time | datetime | 19 | 0 | Y | N | Expiration time | |
# #Table SYS_config (System configuration information table) |
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | The default value | instructions |
---|---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | ||
2 | param_key | varchar | 50 | 0 | Y | N | key | |
3 | param_value | varchar | 2000 | 0 | Y | N | value | |
4 | status | tinyint | 4 | 0 | Y | N | 1 | Status 0: Hidden 1: displayed |
5 | remark | varchar | 500 | 0 | Y | N | note |
Table SYS_DEPT
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | The default value | instructions |
---|---|---|---|---|---|---|---|---|
1 | dept_id | bigint | 20 | 0 | N | Y | ||
2 | parent_id | bigint | 20 | 0 | Y | N | ID of the upper department. The value of the primary department is 0 | |
3 | name | varchar | 50 | 0 | Y | N | Department name | |
4 | order_num | int | 10 | 0 | Y | N | The sorting | |
5 | del_flag | tinyint | 4 | 0 | Y | N | 0 | Delete or not -1: deleted. 0: Normal |
6 | remark | varchar | 255 | 0 | Y | N |
Table SYS_log
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | username | varchar | 50 | 0 | Y | N | The user name |
3 | operation | varchar | 50 | 0 | Y | N | The user action |
4 | method | varchar | 200 | 0 | Y | N | Request method |
5 | params | varchar | 5000 | 0 | Y | N | Request parameters |
6 | time | bigint | 20 | 0 | N | N | Execution time (ms) |
7 | ip | varchar | 64 | 0 | Y | N | The IP address |
8 | create_date | datetime | 19 | 0 | Y | N | Creation time |
Table SYS_menu (Menu Management)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | menu_id | bigint | 20 | 0 | N | Y | |
2 | parent_id | bigint | 20 | 0 | Y | N | ID of the parent menu. The first-level menu is 0 |
3 | name | varchar | 50 | 0 | Y | N | The name of the menu |
4 | url | varchar | 200 | 0 | Y | N | Menu URL |
5 | perms | varchar | 500 | 0 | Y | N | Authorization (multiple users are separated by commas, for example,user: list,user:create) |
6 | type | int | 10 | 0 | Y | N | Type 0: directory 1: menu 2: button |
7 | icon | varchar | 50 | 0 | Y | N | The menu icon |
8 | order_num | int | 10 | 0 | Y | N | The sorting |
Table SYS_OSS (file upload)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | url | varchar | 200 | 0 | Y | N | The URL address |
3 | create_date | datetime | 19 | 0 | Y | N | Creation time |
Table SYS_role
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | role_id | bigint | 20 | 0 | N | Y | |
2 | role_name | varchar | 100 | 0 | Y | N | Character name |
3 | remark | varchar | 100 | 0 | Y | N | note |
4 | create_user_id | bigint | 20 | 0 | Y | N | Creator ID |
5 | create_time | datetime | 19 | 0 | Y | N | Creation time |
6 | dept_id | int | 10 | 0 | Y | N |
Table SYS_ROLE_DEPT (Role and department mapping)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | role_id | bigint | 20 | 0 | Y | N | Character ID |
3 | dept_id | bigint | 20 | 0 | Y | N | Department ID |
Table SYS_ROLE_MENU (Role and menu mapping)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | role_id | bigint | 20 | 0 | Y | N | Character ID |
3 | menu_id | bigint | 20 | 0 | Y | N | Menu ids |
Table SYS_user (system user)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | user_id | bigint | 20 | 0 | N | Y | |
2 | username | varchar | 50 | 0 | N | N | The user name |
3 | password | varchar | 100 | 0 | Y | N | password |
4 | salt | varchar | 20 | 0 | Y | N | salt |
5 | varchar | 100 | 0 | Y | N | ||
6 | mobile | varchar | 100 | 0 | Y | N | Mobile phone no. |
7 | status | tinyint | 4 | 0 | Y | N | Status 0: Disabled 1: Normal |
8 | create_user_id | bigint | 20 | 0 | Y | N | Creator ID |
9 | create_time | datetime | 19 | 0 | Y | N | Creation time |
10 | dept_id | int | 10 | 0 | Y | N | |
11 | stage | varchar | 255 | 0 | Y | N | |
12 | parent_name | varchar | 255 | 0 | Y | N | Department name |
Table SYS_user_role (User and role mapping)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | user_id | bigint | 20 | 0 | Y | N | The user ID |
3 | role_id | bigint | 20 | 0 | Y | N | Character ID |
Table SYS_user_token (System user Token)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | user_id | bigint | 20 | 0 | N | Y | |
2 | token | varchar | 100 | 0 | N | N | token |
3 | expire_time | datetime | 19 | 0 | Y | N | Expiration time |
4 | update_time | datetime | 19 | 0 | Y | N | Update time |
Table tb_user (user)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | user_id | bigint | 20 | 0 | N | Y | |
2 | username | varchar | 50 | 0 | N | N | The user name |
3 | mobile | varchar | 20 | 0 | N | N | Mobile phone no. |
4 | password | varchar | 64 | 0 | Y | N | password |
5 | create_time | datetime | 19 | 0 | Y | N | Creation time |
To obtain source code contact:
Everyone likes, favorites, follows, comments, check the author’s homepage: Java Li Yangyong to get contact
Clocked articles updated 105/365 days
** 👇🏻👇🏻 🏻👇 👇