zoukankan      html  css  js  c++  java
  • jeecmsv8.1怎么修改项目后台访问地址

    将jeeadmin/jeecms/index.do 改为admin/index.do为例  
    1.修改WebContentWEB-INFweb.xml  
    <servlet-mapping>   
    <servlet-name>JeeCmsAdmin</servlet-name>   
    <url-pattern>/jeeadmin/jeecms/*</url-pattern>   
     </servlet-mapping>   
    改为  
    <servlet-mapping>  
    <servlet-name>JeeCmsAdmin</servlet-name>  
    <url-pattern>/admin/*</url-pattern>  
    </servlet-mapping>  
    2.修改WebContentWEB-INFconfigjeecms-servlet-admin.xml  
    <entry key="appBase" value="/jeeadmin/jeecms"/>  
    改为  
    <entry key="appBase" value="/admin"/>  
    3.修改WebContentWEB-INFconfigshiro-context.xml  
    把  
                                   *.jspx = anon  
    *.jhtml = anon  
    /member/forgot_password.jspx = anon  
    /member/password_reset.jspx = anon  
    /login.jspx = authc  
    /logout.jspx = logout  
    /member/** = user  
    /jeeadmin/jeecms/login.do = authc  
    /jeeadmin/jeecms/logout.do = logout  
    /jeeadmin/jeecms/** =user 
    改为  
                                    *.jspx = anon  
    *.jhtml = anon  
    /member/forgot_password.jspx = anon  
    /member/password_reset.jspx = anon  
    /login.jspx = authc  
    /logout.jspx = logout  
    /member/** = user  
    /admin/login.do = authc  
    /admin/logout.do = logout  
    /admin/** =user  

    把  
    <property name="adminLogin" value="/jeeadmin/jeecms/login.do"/>   
    <property name="adminPrefix" value="/jeeadmin/jeecms/"/>   
    改为  
    <property name="adminLogin" value="/admin/login.do"/>  
    <property name="adminPrefix" value="/admin/"/>  

    把  
    <property name="adminIndex" value="/jeeadmin/jeecms/index.do"/>  
    改为  
    <property name="adminIndex" value="/admin/index.do"/>  

    3.修改srccomjeecmscmswebAdminContextInterceptor.java  

    把private static String getURI(HttpServletRequest request) throws IllegalStateException {  
            UrlPathHelper helper = new UrlPathHelper();  
            String uri = helper.getOriginatingRequestUri(request);  
            String ctxPath = helper.getOriginatingContextPath(request);  
            int start = 0, i = 0, count = 2  
            if (!StringUtils.isBlank(ctxPath)) {  
                count++;  
            }  
            while (i < count && start != -1) {  
                start = uri.indexOf('/', start + 1);  
                i++;  
            }  

            if (start <= 0) {  
                throw new IllegalStateException("admin access path not like '/jeeadmin/jeecms/...' pattern: "  
                                                + uri);  
            }  
            return uri.substring(start);  
        }  
    改为  
    private static String getURI(HttpServletRequest request) throws IllegalStateException {  
            UrlPathHelper helper = new UrlPathHelper();  
            String uri = helper.getOriginatingRequestUri(request);  
            String ctxPath = helper.getOriginatingContextPath(request);  
            // int start = 0, i = 0, count = 2;修改  
            int start = 0, i = 0, count = 1;  
            if (!StringUtils.isBlank(ctxPath)) {  
                count++;  
            }  
            while (i < count && start != -1) {  
                start = uri.indexOf('/', start + 1);  
                i++;  
            }  

            if (start <= 0) {  
                throw new IllegalStateException("admin access path not like '/admin/...' pattern: "  
                                                + uri);  
            }  
            return uri.substring(start);  
        }

  • 相关阅读:
    [Go] 实现websocket服务端
    [PHP] php使用event扩展的io复用测试
    [MySQL] 使用force index强制使用索引
    [Go] 使用net包作为tcp客户端读取http
    [Go] golang中的包管理
    [Go] 解决golang.org模块无法下载的问题
    [日常] linux设置环境变量
    [Go] golang定时器与redis结合
    [Go] golang定时器的使用
    [Linux] linux路由表
  • 原文地址:https://www.cnblogs.com/Jeely/p/11214695.html
Copyright © 2011-2022 走看看