Giter VIP home page Giter VIP logo

vhr's Introduction

vhr 是一个脚手架,如需业务完整的项目,请移步这里->TienChin

本项目已使用 SpringBoot3+Vue3 重构,地址:https://github.com/lenve/vhr2.0

扫码加微信(微信ID:a_java_boy3),备注微人事,进群讨论。

微信ID:a_java_boy3

项目介绍

微人事是一个前后端分离的人力资源管理系统,项目采用 SpringBoot+Vue 开发,项目加入常见的企业级应用所涉及到的技术点,例如 Redis、RabbitMQ 等。

项目技术栈

后端技术栈

  1. Spring Boot
  2. Spring Security
  3. MyBatis
  4. MySQL
  5. Redis
  6. RabbitMQ
  7. Spring Cache
  8. WebSocket
  9. ...

前端技术栈

  1. Vue
  2. ElementUI
  3. axios
  4. vue-router
  5. Vuex
  6. WebSocket
  7. vue-cli4
  8. ...

项目效果图

首先,不同的用户在登录成功之后,根据不同的角色,会看到不同的系统菜单,完整菜单如下:

p278

不同用户登录上来之后,可能看到的会有差异,如下:

p279

每个用户的角色是由系统管理员进行分配的,系统管理员给用户分配角色的页面如下:

p280

系统管理员也可以管理不同角色可以操作的资源,页面如下:

p281

快速部署

  1. clone 项目到本地 [email protected]:lenve/vhr.git
  2. 数据库脚本使用 Flyway 管理,不需要手动导入数据库脚本,只需要提前在本地 MySQL 中创建一个空的数据库 vhr,并修改项目中关于数据的配置(resources 目录下的 application.properties 文件中)即可
  3. 提前准备好 Redis,在 项目的 application.properties 文件中,将 Redis 配置改为自己的
  4. 提前准备好 RabbitMQ,在项目的 application.properties 文件中将 RabbitMQ 的配置改为自己的(注意,RabbitMQ 需要分别修改 mailserver 和 vhrserver 的配置文件
  5. 在 IntelliJ IDEA 中打开 vhr 项目,启动 mailserver 模块
  6. 运行 vhrserver 中的 vhr-web 模块

OK,至此,服务端就启动成功了,此时我们直接在地址栏输入 http://localhost:8081/index.html 即可访问我们的项目,如果要做二次开发,请继续看第七、八步。

  1. 进入到vuehr目录中,在命令行依次输入如下命令:
# 安装依赖
npm install

# 在 localhost:8080 启动项目
npm run serve

由于我在 vuehr 项目中已经配置了端口转发,将数据转发到 Spring Boot 上,因此项目启动之后,在浏览器中输入 http://localhost:8080 就可以访问我们的前端项目了,所有的请求通过端口转发将数据传到 Spring Boot 中(注意此时不要关闭 Sprin gBoot 项目)。

  1. 最后可以用 WebStorm 等工具打开 vuehr 项目,继续开发,开发完成后,当项目要上线时,依然进入到 vuehr 目录,然后执行如下命令:
npm run build

该命令执行成功之后,vuehr 目录下生成一个 dist 文件夹,将该文件夹中的两个文件 static 和 index.html 拷贝到 Spring Boot 项目中 resources/static/ 目录下,然后就可以像第 6 步那样直接访问了(关于前后端分离部署,大家也可以参考这个使用 Nginx 部署前后端分离项目,解决跨域问题)。

步骤 7 中需要大家对 NodeJS、NPM 等有一定的使用经验,不熟悉的小伙伴可以先自行搜索学习下,推荐 Vue 官方教程

文档

文档是对项目开发过程中遇到的一些问题的详细记录,主要是为了帮助没有基础的小伙伴快速理解这个项目。

  1. 权限数据库设计
  2. 服务端环境搭建
  3. 动态处理角色和资源的关系
  4. 密码加密并加盐
  5. 服务端异常的统一处理
  6. axios 请求封装,请求异常统一处理
  7. 将请求方法挂到Vue上
  8. 登录状态的保存
  9. 登录成功后动态加载组件
  10. 角色资源关系管理
  11. 用户角色关系管理

更新记录

2018.1.10 更新

本次更新版本:v20180110

本次更新完成了部门管理功能,页面在 [系统管理->基础信息设置->部门管理]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 部门数据库设计与存储过程编写
  2. 递归查询与存储过程调用
  3. Tree 树形控件使用要点

2018.1.12 更新

本次更新版本:v20180112

本次更新完成了职称管理和职位管理,页面在 [系统管理->基础信息设置->职位管理][系统管理->基础信息设置->职称管理]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 职位管理和职称管理功能介绍
  2. 组件复用
  3. [题外话]利用 git 标签回退至任意版本

2018.1.15 更新

本次更新版本:v20180115

本次更新完成了员工基本信息管理,页面在 [员工资料->基本资料]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 员工基本信息管理功能介绍
  2. Spring Boot 中自定义参数绑定

2018.1.16 更新

本次更新版本:v20180116

本次更新完成了员工的高级搜索功能,页面在 [员工资料->基本资料]

相关文档:

  1. 高级搜索功能介绍

2018.1.17 更新

本次更新版本:v20180117

本次更新完成了员工数据的导入导出功能,即可将员工数据导出为Excel,也可以将外部Excel导入到员工数据表中,页面在 [员工资料->基本资料]

相关文档:

  1. Excel 导入导出效果图
  2. SpringMVC 文件下载的两种方式
  3. POI 生成 Excel
  4. axios 下载文件
  5. 使用 POI 实现 Excel 导入

2018.1.19 更新

本次更新版本:v20180119

本次更新主要实现了当管理员添加一个用户时,添加成功后,会根据该用户的邮箱自动向用户发送一封欢迎入职邮件,页面在 [员工资料->基本资料->添加员工] 详情可以参考下面的文档。 注意:邮件发送需要小伙伴小伙伴自己配置授权码,配置方式参考下面的文档,配置文件在src/main/java/org/sang/common/EmailRunnable.java

相关文档:

  1. Spring Boot 中使用 Freemarker 邮件模板生成邮件
  2. Java 中邮件的发送
  3. Spring Boot 中使用新线程发送邮件

2018.1.25 更新

本次更新版本:v20180125

本次更新主要完成了工资账套管理功能,页面在 [薪资管理->工资账套管理]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 工资账套管理功能介绍

2018.1.26 更新

本次更新版本:v20180126

本次更新主要完成了员工账套设置功能,页面在 [薪资管理->员工账套设置]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 员工账套设置功能介绍

2018.2.2 更新

本次更新版本:v20180202

本次更新完成了HR在线聊天功能,页面在 [Home页->右上角铃铛->好友聊天]

相关文档:

  1. 在线聊天功能介绍
  2. 在线聊天功能实现

2018.2.5 更新

本次更新版本:v20180205

本次更新完成了管理员发送系统通知功能,页面在 [Home页->右上角铃铛->系统通知]

本次更新也更新了数据库脚本,小伙伴们需要重新下载数据库脚本执行。

相关文档:

  1. 系统通知功能实现

2019.12.22 更新

本次更新版本:v20191222

本次更新是一次规模较大的更新,整个项目的版本得到升级,同时引入了多模块、RabbitMQ 等技术栈。

相关文档

  1. 两年了,微人事项目迎来了一次重大更新

其他资料

关注公众号江南一点雨,专注于 Spring Boot+微服务,定期视频教程分享,关注后回复 2TB ,领取松哥为你精心准备的超 2TB 免费 Java 学习资源。

公众号二维码

50+ 项目需求文档

Java书单推荐

参考

License

Copyright 2018 王松

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

vhr's People

Contributors

itwanger avatar lenve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vhr's Issues

将项目直接导入到idea中启动会报错,


APPLICATION FAILED TO START


Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

Process finished with exit code 1

应该在启动类中加入@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})注解,原因:这是因为spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。
解决方案来源:https://www.cnblogs.com/yql1986/p/6819097.html

登录校验的地方没找到

调试了一遍项目源码,没有找到本项目是怎么结合spring security 做登录校验的,网上也没找到对应的资料。求教作者和各位兄dei!!

返回回来的数据乱码了

返回回来的数据乱码了,怎么处理呢spring.http.encoding.charset=utf-8
spring.http.encoding.force=true
server.tomcat.uri-encoding=UTF-8
加这些都没有用

服务端Session失效之后就会出问题

因为你把登录数据都保存在localStorage里面了
当你服务端Session过期之后,服务端跳转到login_p这个接口
前端路由判断还是根据localStorage的用户信息来判断的,这个信息除了手动删除一直存在
所以前端路由直接通过了,并没有跳转到登录页面

关于loadUserByUsername方法实现

loadUserByUsername(String s)的方法实现好像只有根据userName进行查找,password并没有参与,这样会不会有问题?
select * from hr WHERE username=#{username};

请教个问题

你好,可以请教个问题吗?
我按照你的security配置,可是decide和filter的getAttributes方法都没走进来。
不知道是为什么,我两次配置都这样,你遇到这个问题吗,麻烦指导一下。。

还有很多功能未开发

还有很多功能未开发,请尽快更新,如有可能我愿意加入进来,一起完善,否则这个项目无法使用

windows编译问题

您好,我用windows系统vue run dev后, depMana.vue会报uncpect synatic异常在181行,mac系统下就没这问题,请问你在开发的时候有遇到过这问题么

axios post请求传递参数问题

user : {
name: '张三',
age: 12,
xx:{
a: 1,
b: 'tome'
}
}
类似这样的格式参数, 在传递时报400错误, 现在知道是因为xx这个内嵌json导致的, 去掉了就成了200状态码了. 这样的有什么办法解决么???

自定义登陆页设置

为什么我设置了自定义登陆页,还是跳转到了security自带的默认登陆界面。或者说是我哪里设置错了嘛?想咨询一下,自定义登陆页在哪里设置

login controller没有配置

在server端代码cotroller并没有配置@RequestMapping("/login“),那么VUE的代码 this.postRequest('/login', {
username: this.loginForm.username,
password: this.loginForm.password
}) 就会返回404错误

IDEA引入工程启动不成功

用IDEA引入工程时启动不成功, 原因是hrserver的pom里定义了resources结点而没有把src/main/resources加在resources结点内, 需手动把resources目录Mark as resource root

建议在resources结点下增加src/main/resources

帮忙开发

楼主 今天刚看到你的项目。不错,暑假这段时间我会尽快熟悉系统,然后开发。

'dataSource' 应该还没有配置完全把?

2018-01-12 11:50:38.436 WARN 10080 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'urlFilterInvocationSecurityMetadataSource': Unsatisfied dependency expressed through field 'menuService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'menuService': Unsatisfied dependency expressed through field 'menuMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'menuMapper' defined in file [D:\Workspaces\IDEAWORK\vhr-master\hrserver\target\classes\org\sang\mapper\MenuMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

对权限设计的疑问

假设有两个业务:教师管理、课程管理,分别对应:教师管理菜单、课程管理菜单。在给教师指定课程的时候需要用到课程管理的接口,URL应该是课程管理提供的。
如果只把教师管理分给某个角色,那么在使用教师管理功能时,前端调用课程管理的接口可以通过权限验证吗?

为什么是/user/queue/chat,而不是/queue/chat?

下面的这行代码看不懂,为什么是/user/queue/chat,而不是/queue/chat

context.state.stomp.subscribe("/user/queue/chat", message=> {......}

这个/user前缀是哪儿来的?后端配置的是只能识别/queue开头的或者/topic开头的,为什么/user/queue开头的也能识别?百思不得其解

登录页面如何为/login?

按照这样的配置and().formLogin().loginPage("/login_p")
如果URL里面是localhost:8080, 页面将获得如下结果:
{"status":"error","msg":"尚未登录,请登录!"}
这样是否有问题?
真正的登录页面不会显示。

权限问题疑虑

你好,我想问一下你这个项目的菜单是怎么添加的?

更新速度偏慢

您好,请问下次更新什么时候,如果可以,可不可以加人一起维护这个项目

注册

新的员工注册界面,,,我一直都没有找到...

Cannot determine embedded database driver class for database type NONE

`Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-01-10 09:14:51.962 ERROR 49060 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

`
楼主报了这个错,没有run起来

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.