提交 08fe8604 编写于 作者: Y YZJ
# 领课在线教育开源系统
# 领课在线教育系统
### 项目介绍
领课在线教育开源系统是基于领课团队多年的在线教育开发和运营经验的产品
领课在线教育系统是基于领课团队多年的在线教育开发和运营经验的产品,打造一个全行业都适用的在线教育系统。
### 功能介绍
* 具有录播功能,直播功能即将上线
* 讲师入驻功能,讲师自主管理课程
* 课程管理功能,讲师上传的课程后台有审核功能
* 单用户登录功能,同一时间只允许同一个账号在同一个地方登录,防止账号共享
* 支付功能,系统无缝集成了龙果支付面
### 技术选
* 核心技术框架:Spring Cloud
* 权限管理功能,多角色多用户自定义配置
* 系统配置功能,自定义进行站点配置及第三方参数配置
* 讲师管理功能,讲师申请入驻,后台具有审核功能
* 课程管理功能,讲师管理自有课程,后台具有审核功能
* 用户登录功能,同一时间只允许同一个账号在同一个地方登录,防止账号共享
* 广告管理功能,后台自定义广告设置,增加营销效果
* 支付功能,系统无缝集成了龙果支付
### 技术选型
| 核心技术框架 | 注册中心 | 服务网关 | 负载均衡 |
| ----------------- | ----------------- | ----------------- | ------------------ |
| Spring Cloud | Eureka | Zuul | Feign + Ribbon |
| 断路器 | 持久层 | 连接池 | 缓存 |
| Hystrix | Mybatis | Druid | Redis |
| 模板引擎 | 日志框架 | 常用工具 | 版本维护 |
| Freemarker | Logback | Hutool | Spring IO Platform |
### 加速maven构建
在maven的settings.xml 文件里配置mirrors的子节点,添加如下mirror
......@@ -40,5 +48,5 @@ Lombok是一个可以通过简单的注解形式来帮助我们简化消除一
![流程图](/doc/images/lombok1.png)
## 项目推荐
### roncoo-recharge:[码云地址](https://gitee.com/roncoocom/roncoo-recharge) | [Github地址](https://github.com/roncoo/roncoo-recharge)
### roncoo-jui-springboot:[码云地址](https://gitee.com/roncoocom/roncoo-jui-springboot) | [Github地址](https://github.com/roncoo/roncoo-jui-springboot)
\ No newline at end of file
##### roncoo-recharge:[码云地址](https://gitee.com/roncoocom/roncoo-recharge) | [Github地址](https://github.com/roncoo/roncoo-recharge)
##### roncoo-jui-springboot:[码云地址](https://gitee.com/roncoocom/roncoo-jui-springboot) | [Github地址](https://github.com/roncoo/roncoo-jui-springboot)
\ No newline at end of file
......@@ -26,7 +26,7 @@ public class ZoneBO implements Serializable {
/**
* 位置(1电脑端,2微信端)
*/
@ApiModelProperty(value = "展示平台")
@ApiModelProperty(value = "展示平台", required = true)
private Integer zoneLocation;
/**
......
......@@ -2,7 +2,7 @@
spring.profiles.active=dev
# eureka
eureka.client.serviceUrl.defaultZone=http://${info.eureka.host01}:${info.eureka.port01}/eureka/,http://${info.eureka.host02}:${info.eureka.port02}/eureka/
eureka.client.serviceUrl.defaultZone=http://${info.eureka.host}:${info.eureka.port}/eureka/
eureka.environment=${spring.profiles.active}
eureka.datacenter=roncoo
......
......@@ -13,7 +13,7 @@ import lombok.Getter;
@AllArgsConstructor
public enum StatusIdEnum {
NO(0, "禁用", "red"), YES(1, "正常", "");
YES(1, "正常", ""), NO(0, "禁用", "red");
private Integer code;
......
# 使用方法:把config.properties.demo重命名为config.properties即可
# 本地环境配置文件
# 视频存放路径
period_video_path=/home/roncoo/file/video/
# 图片存放路径
pic_path=/home/roncoo/file/pic/
# 阿里云配置
aliyun_accessKeyId=
aliyun_accessKeySecret=
# 阿里云OSS配置
aliyun_oss_url= #配置的域名
aliyun_oss_bucket= #bucket
aliyun_oss_endpoint=http://oss-cn-shanghai.aliyuncs.com/
# 阿里云OAS配置
aliyun_oas_url=http://cn-shenzhen.oas.aliyuncs.com
aliyun_oas_vault= #vault
# 龙果支付回调配置
roncoo_pay_notify= #通知回调地址
pay_url= #请求地址
pay_key= #key
pay_secret= #secret
# 保利威视
polyv_getCataUrl=http://v.polyv.net/uc/services/rest?method=getCata&readtoken={READ_TOKEN}
polyv_uploadVideo=http://v.polyv.net/uc/services/rest?method=uploadfile
polyv_changeCataUrl=http://api.polyv.net/v2/video/{userid}/changeCata?vids={VIDS}&cataid={CATAID}&ptime={PTIME}&sign={SIGN}
polyv_delVideoById=http://v.polyv.net/uc/services/rest?method=delVideoById&writetoken={WRITE_TOKEN}&vid={VID}
polyv_deleteVideo=http://api.polyv.net/v2/video/{userid}/del-video
polyv_getToken=https://hls.videocc.net/service/v1/token
polyv_question=http://v.polyv.net/uc/services/rest
polyv_useId= #userId
polyv_writetoken= #writetoken
polyv_readtoken= #readtoken
polyv_secretkey= #secretkey
# 讲师默认分成
lecturer_default_proportion=0.7000
......@@ -3,23 +3,37 @@
*/
package com.roncoo.education.web.boss.common;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.roncoo.education.util.base.Base;
import com.roncoo.education.util.base.Bjui;
import com.roncoo.education.util.tools.Constants;
import com.roncoo.education.util.tools.JSONUtil;
import com.roncoo.education.web.boss.common.bean.vo.SysMenuVO;
import com.xiaoleilu.hutool.util.CollectionUtil;
/**
* 拦截器
*/
@Configuration
public class ConfigurationWebMvc implements WebMvcConfigurer{
public class ConfigurationWebMvc implements WebMvcConfigurer {
private static final String[] PATH = new String[] { "/admin/**", "/course/**", "/system/**", "/user/**" };
@Bean
ShiroInterceptor shiroInterceptor() {
......@@ -28,7 +42,7 @@ public class ConfigurationWebMvc implements WebMvcConfigurer{
@Override
public void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(shiroInterceptor()).addPathPatterns("/admin/**");
registry.addInterceptor(shiroInterceptor()).addPathPatterns(PATH);
}
}
......@@ -39,7 +53,51 @@ class ShiroInterceptor extends Base implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
return true;
String uri = request.getServletPath();
if (checkUri(uri)) {
return true;
}
logger.error("没此权限,当前访问路径为:{}", uri);
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
Bjui bj = new Bjui();
bj.setStatusCode(300);
bj.setMessage("没此权限,请联系管理员!");
out.print(JSONUtil.toJSONString(bj));
out.flush();
out.close();
return false;
}
private static Boolean checkUri(String uri) {
List<SysMenuVO> menuVOList = JSONUtil.parseArray(SecurityUtils.getSubject().getSession().getAttribute(Constants.Session.BOSS_MENU).toString(), SysMenuVO.class);
Set<String> menuSet = new HashSet<>();
listMenu(menuSet, menuVOList);
if (StringUtils.hasText(uri) && uri.endsWith("/")) {
uri = uri.substring(0, uri.length() - 1);
}
for (String s : menuSet) {
if (s.contains(uri)) {
return true;
}
}
return false;
}
/**
* @param list
* @return
*/
private static void listMenu(Set<String> menuSet, List<SysMenuVO> menuVOList) {
if (CollectionUtil.isNotEmpty(menuVOList)) {
for (SysMenuVO sm : menuVOList) {
if (StringUtils.hasText(sm.getMenuUrl())) {
menuSet.add(sm.getMenuUrl());
}
listMenu(menuSet, sm.getList());
}
}
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册