GithubHelp home page GithubHelp logo

itnpc / wh-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smallsnail-wh/wh-server

0.0 2.0 0.0 2.8 MB

spring boot项目,与我的另外一个前端项目wh-web搭配(前后端分离)

Home Page: https://smallsnail-wh.github.io

Java 100.00%

wh-server's Introduction

wh-server

项目版本升级1.0.1

  1. spring boot 2.0.0.M5 --> spring boot 2.0.0.M7
  2. spring security 4 --> spring security 5
  3. 用户token信息,从内存存储变为redis存储
  4. 客户的详细资料由手动在MyAuthorizationServerConfigurerAdapter中配置的,改为使用数据库配置(添加了oauth_client_details表)
  5. 用户密码加密由md5加密改为BCrypt加密
  6. 打包方式由jar改为war(可根据自己需要更改)

项目介绍

spring boot项目,与我的另外一个前端项目wh-web搭配(前后端分离)。

项目展示

地址:https://smallsnail-wh.github.io 用户名:admin 密码:admin (第一次打开可能会有点慢)

技术栈

  • spring boot
  • mybatis
  • Spring Security
  • Spring Security OAuth2
  • Redis

接口设计:

RESTful

认证与授权:

使用了Spring Security OAuth2

数据库:

使用mysql。(表与表数据在wh-server\src\main\resources\createTable中,用户密码为BCrypt加密,用户admin的密码为admin)

设计思路

  1. 用户表sys_user:存储用户基本信息。
  2. 角色表sys_role:存储不同的角色。
  3. 菜单表sys_menu:存储菜单信息。
  4. 用户和角色关系表r_user_role:存储用户和角色的关系。 逻辑是sys_user表通过id关联r_user_role表得到对应的角色ids,再通过得到的角色ids关联sys_role表得到对应的菜单ids,然后通过菜单ids关联sys_menu表得到前端需要显示的菜单数据。

项目搭建

运行环境:

jdk1.8+maven。

数据库配置:

数据库mysql(表与表数据在wh-server\src\main\resources\createTable中,用户密码为BCrypt加密,用户admin的密码为admin)

缓存配置:

配置redis,且redis服务必须开启。

注:

  1. 此后端是授权服务和资源服务在一个项目中,建议将授权服务和资源服务分离成2个项目。
  2. 如果你想采用上述建议,但是无从下手,请在我的github中留言。

如果你项目启动有错误:

  1. 检查数据库是否配置好。(表与表数据在wh-server\src\main\resources\createTable中,用户密码为BCrypt加密,用户admin的密码为admin)
  2. 检查redis是否配置好,redis服务必须开启(检查防火墙是否打开)
  3. 如果控制台报Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter错误,请更改依赖文件中的tomcat依赖范围,后期如果你需要打war包,需要将tomcat依赖范围更改回来。
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-tomcat</artifactId>
		<!-- <scope>provided</scope> -->
	</dependency>

2018.03.20更改类容

将普通token在redis中存储形式 --> jwt token形式

2018.04.10更改类容

jwt token形式 --> jwt形式+redis存储

该项目的升级版:

https://github.com/smallsnail-wh/interest

wh-server's People

Contributors

smallsnail-wh avatar

Watchers

 avatar  avatar

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.