2 Star 0 Fork 0

insky2005 / tangram-framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Platform Framework

基本Maven操作

  • 修改项目版本号
$ mvn versions:set -DnewVersion=2.0.0-SNAPSHOT
  • 上传到maven仓库
$ mvn deploy

项目说明

Core

platform-core-common 通用的工具类

platform-core-cache 缓存实现(支持内存、EhCache、Redis)

platform-core-framework 基础框架(annotation、缓存工具类、异常处理、过滤器、分页拦截器、监听、上传下载servlet、实体抽象类、DAO抽象类、控制器抽象类)

Module

platform-module-domain 通用实体(日志表,用户表、角色表、功能表等)

platform-module-interface 通用实体的DAO操作类的接口定义

platform-module-log 日志模块,日志的收集、入库功能的实现

platform-module-authority-db 用户、角色、功能模块,实现了基于独立数据表的用户、角色、功能数据的获取

platform-module-authority-uniauth 用户、角色、功能模块,实现了基于认证视图的用户、角色、功能数据的获取(即相关数据的维护在认证中)

platform-module-authority 用户、角色、功能模块,相关 API 接口

platform-module-security-oauth2 安全模块,OAuth2 的整合,基于 Spring Securiy OAuth2 的配置,可集成 CAS

platform-module-security 安全模块,基于角色的访问控制实现

platform-module-resources 资源模块,暂无(不知道怎么用)

Examples

platform-examples-web-admin-authserver WebAuth,OAuth认证中心,同时提供用户、角色、功能相关数据的API接口,持久层采用 mybatis,基于数据表的权限控制

platform-examples-web-admin-dashboard WebAdmin,管理中心,采用前后端分离模式开发(但前后端代码在一个web项目下),与 WebAuth 整合,持久层采用 mybatis,基于数据表的权限控制

废弃 platform-examples-web-api WebAPI,又可称为后端接口,主要是以 restful 的方式提供接口,由前端调用,访问控制权限由 OAuth2 控制

废弃 platform-examples-web-client WebClient,为前端UI,主要是 html + js(ajax),调用后 WebAPI 获取数据或提交数据

platform-examples-web-app WebAPP,采用前后端分离模式开发(但前后端代码在一个web项目下),持久层采用 mybatis,基于认证视图的权限控制

platform-examples-web-mvc WebMVC,采用传统MVC实现,freemarker 视图解析,持久层采用 hibernate,基于数据表的权限控制 ,整合CAS

流程说明

以 platform-examples-web-admin-authserver、platform-examples-web-admin-dashboard 为例

项目 platform-examples-web-admin-authserver(简称:web-admin-authserver) 为 OAuth认证中心,主要提供登录,资源授权,颁发token,提供用户、角色、功能相关数据的API接口

项目 platform-examples-web-admin-dashboard(简称:web-admin-dashboard) 为 管理中心,主要实现各个功能的UI展现,同时,也可以实现业务功能的API接口实现

本地登录模式

登录流程

1、用户访问 web-admin-dashboard ,访问需要登录的功能时,系统会跳转到 web-admin-authserver 进行登录

2、用户在 web-admin-authserver 登录后,生成 code,并跳转返回到 web-admin-dashboard,

3、web-admin-dashboard 会调用 web-admin-authserver 的接口验证 code,并获取到 access_token,保存到浏览器 Cookie

请求跳转: http://localhost:10008/web-admin-dashboard/ http://localhost:10008/web-admin-dashboard/html/admin/index.html?t=1497512356108 http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login http://localhost:10008/web-admin-authserver/oauth/authorize?client_id=client-api-resource&redirect_uri=http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login&response_type=code&scope=read%20write%20trust&state=o3UKFQ http://localhost:10008/web-admin-authserver/login.jsp # 用户输入用户名、密码,提交登录 http://localhost:10008/web-admin-authserver/oauth/login http://localhost:10008/web-admin-authserver/oauth/authorize?client_id=client-api-resource&redirect_uri=http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login&response_type=code&scope=read%20write%20trust&state=o3UKFQ http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login?code=84er1o&state=o3UKFQ # OAuth2ClientAuthenticationProcessingFilter 根据 code 可以获取到 access_token http://localhost:10008/web-admin-dashboard/html/admin/index.html?t=1497512356108

注销流程

1、用户登录 web-admin-dashboard 后,点击 web-admin-dashboard 的注销,系统先将本地 session 清理后,跳转到 web-admin-authserver 进行注销

2、web-admin-authserver 注销后,web-admin-authserver 会跳转回到 web-admin-dashboard 的系统首页

请求跳转:

http://localhost:10008/web-admin-dashboard/html/logout http://localhost:10008/web-admin-authserver/oauth/logout?targetUrl=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-dashboard%2Findex.jsp http://localhost:10008/web-admin-authserver/oauth/logout?returnUrl=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-dashboard%2Findex.jsp # 注销成功后,跳转到 returnUrl http://localhost:10008/web-admin-dashboard/index.jsp http://localhost:10008/web-admin-dashboard/html/hall/index.html?t=1497515043155

认证集成模式

登录流程

1、用户访问 web-admin-dashboard ,访问需要登录的功能时,系统会跳转到 web-admin-authserver 进行登录

2、web-admin-authserver 会跳转到 casserver 进行登录

3、用户在 casserver 登录后,生成 ticket,并返回到 web-admin-authserver

4、web-admin-authserver 验证票据成功后,生成 code,并跳转返回到 web-admin-dashboard

5、web-admin-dashboard 会调用 web-admin-authserver 的接口验证 code,并获取到 access_token,保存到浏览器 Cookie

请求跳转: http://localhost:10008/web-admin-dashboard/ http://localhost:10008/web-admin-dashboard/html/admin/index.html?t=1497512356108 http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login http://localhost:10008/web-admin-authserver/oauth/authorize?client_id=client-api-resource&redirect_uri=http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login&response_type=code&scope=read%20write%20trust&state=o3UKFQ http://app.supwisdom.com:9080/cas/login?service=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-authserver%2Fj_spring_cas_security_check # 用户输入用户名、密码,提交登录 http://app.supwisdom.com:9080/cas/login?service=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-authserver%2Fj_spring_cas_security_check http://localhost:10008/web-admin-authserver/j_spring_cas_security_check?ticket=ST-119-WgMe16Jd6Qngqc3diW5r-cas http://localhost:10008/web-admin-authserver/oauth/authorize?client_id=client-api-resource&redirect_uri=http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login&response_type=code&scope=read%20write%20trust&state=o3UKFQ http://localhost:10008/web-admin-dashboard/html/oauth2client/oauth2login?code=84er1o&state=o3UKFQ # OAuth2ClientAuthenticationProcessingFilter 根据 code 可以获取到 access_token http://localhost:10008/web-admin-dashboard/html/admin/index.html?t=1497512356108

注销流程

1、用户登录 web-admin-dashboard 后,点击 web-admin-dashboard 的注销,系统先将本地 session 清理后,跳转到 web-admin-authserver 进行注销

2、web-admin-authserver 注销后,会跳转到 casserver 进行注销

3、casserver 注销后,用户选择返回系统,则跳转返回到 web-admin-authserver

2、web-admin-authserver 会跳转回到 web-admin-dashboard 的系统首页

请求跳转:

http://localhost:10008/web-admin-dashboard/html/logout http://localhost:10008/web-admin-authserver/oauth/logout?targetUrl=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-dashboard%2Findex.jsp http://localhost:10008/web-admin-authserver/cas/logout?targetUrl=http://localhost:10008/web-admin-authserver/cas/logout?returnUrl=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-dashboard%2Findex.jsp http://app.supwisdom.com:9080/cas/logout?service=http%3A%2F%2Flocalhost%3A10008%2Fweb-admin-authserver%2Fcas%2Flogout%3FreturnUrl%3Dhttp%3A%2F%2Flocalhost%3A10008%2Fweb-admin-dashboard%2Findex.jsp http://app.supwisdom.com:9080/cas/singlesignout/singlesignout.jsp?service=http://localhost:10008/web-admin-authserver/cas/logout?returnUrl=http://localhost:10008/web-admin-dashboard/index.jsp # 用户点击 返回系统 http://localhost:10008/web-admin-authserver/cas/logout?returnUrl=http://localhost:10008/web-admin-dashboard/index.jsp # 注销成功后,跳转到 returnUrl http://localhost:10008/web-admin-dashboard/index.jsp http://localhost:10008/web-admin-dashboard/html/hall/index.html?t=1497515043155

The MIT License (MIT) Copyright (c) 2016 insky2005 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

七巧板 - APP项目快速开发框架 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/insky2005/tangram-framework.git
git@gitee.com:insky2005/tangram-framework.git
insky2005
tangram-framework
tangram-framework
3.0.x

搜索帮助