在线课堂搭建注意事项

RealTimeClassRoom修改的文件

将服务器环境搭建好之后需要修改以下几个文件:

  • property.properties

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    //mysql链接,如果是远程数据库,修改为远程数据库的链接和端口
    mysql.url=jdbc\:mysql\://127.0.0.1\:3307/zzkt_ofbiz?&useUnicode\=true&characterEncoding\=utf-8&autoReconnect\=true
    mysql.drivername=com.mysql.jdbc.Driver
    mysql.username=root
    mysql.password=****
    mysql2.url=jdbc\:mysql\://127.0.0.1\:3307/ofbiz?&useUnicode\=true&characterEncoding\=utf-8&autoReconnect\=true
    mysql2.username=root
    mysql2.password=****
    //mongo的url也需要更改,用远程的也可以
    mongo.url=115.28.233.32
    mongo.port=27017
    mongo.dbname=RealTimeClass
    UseRecordCollectionName=UserOPRecord
    mongo.username=root
    mongo.password=123456
    mongo.maxconn=5000
    mongo.minconn=100
    class.aheadoftime=30
  • platform.properties

    1
    2
    3
    4
    5
    6
    7
    8
    //修改为服务器所在域名加上端口号
    DOMAIN=http\://sso.zzkt.com\:8080
    //不用修改
    PLAT_APP_NAME=eduportal/
    //不用修改
    PLAT_PHOTO_NAME=app/
    //修改为服务器所在域名
    CERTIFICATION_SERVER=sso.zzkt.com
  • aodianyun.properties

    1
    2
    3
    4
    5
    6
    7
    //修改为自己奥点运平台的参数
    AODIANYUN_LIST_URL=http\://openapi.aodianyun.com/v2/VOD.GetVodList
    ACCESS_ID=
    ACCESS_KEY=
    APPNAME=sskt
    PUBLISH_URL=
    PLAY_URL=
  • web.xml

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    <filter>
    <filter-name>CASFilter</filter-name>
    <!-- <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> -->
    <filter-class>cn.edu.pku.ss.casfilter.AuthenticationFilterWithExcludeUrl</filter-class>
    <init-param>
    <param-name>casServerLoginUrl</param-name>
    <param-value>http://sso.zzkt.com:8080/cas/login</param-value>
    <!-- <param-value>http://online.sunhopeww.com:8080/cas/login</param-value> -->
    <!--这里的server是服务端的IP -->
    </init-param>
    <init-param>
    <!--本程序所在的URL -->
    <param-name>serverName</param-name>
    <param-value>http://sso.zzkt.com:8080</param-value>
    <!-- <param-value>http://online.sunhopeww.com:8080</param-value> -->
    </init-param>
    <init-param>
    <param-name>exclusions</param-name>
    <param-value>/register/checkUsername.action,/search/famousCourseSearch.action,/studentUCenter/studentUCenter.action,/teacherUCenter/teacherUCenter.action,/register/doRegister.action,/register/register.action,/index/queryIndex.action,/iframe/queryIframeCourse.action,/courseShow/getCourse.action,/studentCourseManage/chooseCourseForWS.action,/sskt_logout/sskt_logout.action,/courseManage/approveCourse.action,/liveshow/apiLiveShowAction.action,/apicourse/getCourseInforByID.action,/apicourse/getCourseInforByTeacherID.action,/apicourse/getUnderWayCourseInfor.action,/yitiku/loginYiTiKu.action,/apicourse/getCourseListByCatagory.action,/apicourse/getCourseInforByProductID.action,/apiteacher/applyCourseAction.action,/user/getAllClassesInfoByTeacherID.action,/user/getAllStudentInfoByGradeIDAndClassID.action,/user/getAllStudentInfoByTeacherID.action</param-value>
    </init-param>
    </filter>
    <!-- 该过滤器负责对Ticket的校验工作,必须启用它 -->
    <filter>
    <filter-name>CAS Validation Filter</filter-name>
    <filter-class>
    org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter
    </filter-class>
    <init-param>
    <param-name>casServerUrlPrefix</param-name>
    <param-value>http://sso.zzkt.com:8080/cas</param-value>
    <!-- <param-value>http://online.sunhopeww.com:8080/cas</param-value> -->
    </init-param>
    <init-param>
    <param-name>serverName</param-name>
    <param-value>http://sso.zzkt.com:8080</param-value>
    <!-- <param-value>http://online.sunhopeww.com:8080</param-value> -->
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>CAS Validation Filter</filter-name>
    <url-pattern>*.action</url-pattern>
    </filter-mapping>
  • webroot/static-new/js/ownjs/course-detail.js

    1
    2
    3
    4
    5
    6
    7
    //未登录点击购买课程按钮
    $("#notLoginPurchase").click(function(){
    var courseId = $("#courseId").val();
    alert("请您先登录");
    window.location.href='http://sso.zzkt.com:8080/cas/login?service=http://sso.zzkt.com:8080/RealTimeClassRoom/courseShow/getCourse.action?courseId='+courseId+'&&pamCasLoginId=1';
    // window.location.href='http://online.sunhopeww.com:8080/cas/login?service=http://online.sunhopeww.com:8080/RealTimeClassRoom/courseShow/getCourse.action?courseId='+courseId+'&&pamCasLoginId=1';
    });

CAS要修改的文件

  • web-inf/depolyerConfigContext.xml

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <bean id="primaryAuthenticationHandler"
    class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">
    <property name="dataSource" ref="dataSource"></property>
    <property name="sql" value="select password from sskt_user where userId=?"></property>
    <property name="passwordEncoder" ref="passwordEncoder"/>
    </bean>
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
    <property name="url"><value>jdbc:mysql://127.0.0.1:3307/zzkt_ofbiz</value></property>
    <property name="username"><value>root</value></property>
    <property name="password"><value>mysql123</value></property>
    </bean>
  • /cas/WEB-INF/view/jsp/default/ui/casLogoutView.jsp

    1
    2
    3
    4
    5
    function doSomeLogout(){
    //getLabelsGet("http://121.42.149.42:6301/logout");
    getLabelsGet("http://sso.zzkt.com:8080/RealTimeClassRoom/sskt_logout/sskt_logout.action");
    //getLabelsGet("http://121.42.149.42:6300/logout");
    }