未验证 提交 7c90d488 编写于 作者: N Nicky 提交者: GitHub

Update README.md

上级 9681678a
......@@ -35,7 +35,7 @@ ps:登录链接一般为:http://127.0.0.1:8080/jeeplatform/login
暂时接入Oauth2.0实现的单点登录系统
## 三、关键技术
### 单点登录基础(模块名称jeeplatform-sso-cas)(功能修整中)
### CAS单点登录基础(模块名称jeeplatform-sso-cas)(功能修整中)
> 项目采用CAS实现单点登录,单点登录集群搭建可以参考博客:
> http://blog.csdn.net/u014427391/article/details/78653482
> 项目单点登录:使用nginx作为负载均衡,使用redis存储tomcat session,来实现集群中tomcat session的共享,使用redis作为cas ticket的仓库,来实现集群中cas ticket的一致性。OA已经对接CAS,admin工程暂时不对接CAS
......@@ -45,109 +45,18 @@ ps:登录链接一般为:http://127.0.0.1:8080/jeeplatform/login
![这里写图片描述](https://img-blog.csdn.net/20180902172712501?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTQ0MjczOTE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
CAS单点登录原理,图来自官网
![这里写图片描述](https://img-blog.csdn.net/20180826231806797?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTQ0MjczOTE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
单点登录集群方案如图
![Image text](https://github.com/u014427391/jeeplatform/raw/master/screenshot/单点登录集群.png)
### OAuth2.0单点登录基础(模块名称jeeplatform-sso-oauth2)(功能修整中)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200511144921931.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTQ0MjczOTE=,size_16,color_FFFFFF,t_70)
### SpringBoot集成Redis缓存处理(Spring AOP实现)
先从Redis里获取缓存,查询不到,就查询MySQL数据库,然后再保存到Redis缓存里,下次查询时直接调用Redis缓存
```
package org.muses.jeeplatform.cache;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
/**
* AOP实现Redis缓存处理
*/
@Component
@Aspect
public class RedisAspect {
private static final Logger LOGGER = LoggerFactory.getLogger(RedisAspect.class);
@Autowired
@Qualifier("redisCache")
private RedisCache redisCache;
/**
* 拦截所有元注解RedisCache注解的方法
*/
@Pointcut("@annotation(org.muses.jeeplatform.annotation.RedisCache)")
public void pointcutMethod(){
}
/**
* 环绕处理,先从Redis里获取缓存,查询不到,就查询MySQL数据库,
* 然后再保存到Redis缓存里
* @param joinPoint
* @return
*/
@Around("pointcutMethod()")
public Object around(ProceedingJoinPoint joinPoint){
//前置:从Redis里获取缓存
//先获取目标方法参数
long startTime = System.currentTimeMillis();
String applId = null;
Object[] args = joinPoint.getArgs();
if (args != null && args.length > 0) {
applId = String.valueOf(args[0]);
}
//获取目标方法所在类
String target = joinPoint.getTarget().toString();
String className = target.split("@")[0];
//获取目标方法的方法名称
String methodName = joinPoint.getSignature().getName();
//rediskey格式: applId:方法名称
String redisKey = applId + ":" + className + "." + methodName;
Object obj = redisCache.getDataFromRedis(redisKey);
if(obj!=null){
LOGGER.info("**********从Redis中查到了数据**********");
LOGGER.info("Redis的KEY值:"+redisKey);
LOGGER.info("REDIS的VALUE值:"+obj.toString());
return obj;
}
long endTime = System.currentTimeMillis();
LOGGER.info("Redis缓存AOP处理所用时间:"+(endTime-startTime));
LOGGER.info("**********没有从Redis查到数据**********");
try{
obj = joinPoint.proceed();
}catch(Throwable e){
e.printStackTrace();
}
LOGGER.info("**********开始从MySQL查询数据**********");
//后置:将数据库查到的数据保存到Redis
String code = redisCache.saveDataToRedis(redisKey,obj);
if(code.equals("OK")){
LOGGER.info("**********数据成功保存到Redis缓存!!!**********");
LOGGER.info("Redis的KEY值:"+redisKey);
LOGGER.info("REDIS的VALUE值:"+obj.toString());
}
return obj;
}
}
```
![这里写图片描述](http://img.blog.csdn.net/20171214104250995?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxNDQyNzM5MQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
可以看到Redis里保存到了缓存
......@@ -156,7 +65,7 @@ public class RedisAspect {
## 四、业务方案
### 系统管理通用功能
- [] 单点登录: OAuth2.0+JWT单点登录/CAS单点登录
- [ ] 单点登录: OAuth2.0+JWT单点登录/CAS单点登录
- [x] 用户管理: 系统用户
- [x] 角色管理: 按照企业系统职能进行角色分配,每个角色具有不同的系统操作权限
- [x] 权限管理: 权限管理细分到系统菜单权限
......@@ -181,10 +90,10 @@ public class RedisAspect {
* 工作流引擎:Activiti5(待定)
* ORM框架:Mybatis
* Web框架:SpringMVC
* 核心框架:Spring Framework4.0
* 核心框架:SpringBoot
* 任务调度:Spring Task(待定)
* 权限安全:Apache Shiro
* 全文搜索引擎:Lucene
* 权限安全:Apache Shiro、Spring Security
* 全文搜索引擎:Lucene(待定)
* 模板引擎:JSP(还没使用Thymeleaf,前端需要重构)
* 服务器页面包含技术:SSI(待定)
* 网页即时通讯:websocket
......@@ -202,25 +111,6 @@ public class RedisAspect {
* 富文本编辑器:Baidu UEDitor
* 前端框架:Twitter Bootstrap
### 服务器
* 负载均衡:Nginx
* 分布式:alibaba Dubbo(待定)
* 中间件:RocketMQ(待定)
### 项目测试
* DeBug:Junit、FindBugs、EclEmma
* 程序质量:Jdepend4eclipse
* 压力测试:JMeter(待定)
### 工具软件
* 服务器:SecureCRT
* Java:IntelliJ IDEA
* 远程控制:TeamViewer
* 版本控制:Git、smartgit
* Jar管理:Maven
* UML建模:ArgoUML
* Eclipse测试插件:EclEmma
* 程序质量检查插件:Jdepend4eclipse(Eclipse平台)
## 六、常见问题
运行jeeplatform打开页面404,如果是用idea的,就可以edit configurations->configuration->edit working directory设置为:$MODULE_DIR$
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册