jeecms v9修改后台访问地址

将jeeadmin/jeecms/index.do 改为admin/index.do为例

修改WebContent\WEB-INF\web.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>
修改WebContent\WEB-INF\config\jeecms-servlet-admin.xml
<entry key="appBase" value="/jeeadmin/jeecms"/>
改为

<entry key="appBase" value="/admin"/>
修改WebContent\WEB-INF\config\shiro-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"/>
修改\src\com\jeecms\cms\web\AdminContextInterceptor.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); 
}
通过数据库修改密码
通过数据库修改 admin 密码
select * from core_user;
|       1 | admin      | jobar     | 0230504dd5de96d2f6784d45d1bc7633 |
密码已经是被加密过的了。

密码加密类:com.ponyjava.common.util.Md5PwdEncoder

例如我想将密码设为 “zhaozh”, 就先用这个类加密,然后更新数据库就 ok 了。

public class Test {
    public static void main(String[] args) {
        Md5PwdEncoder encoder = new Md5PwdEncoder();
        System.out.println(encoder.encodePassword("zhaozh"));
    }
}
输出为:f06238ff925a61f9c62de7d64c64bad3

mysql>

update core_user set password='f06238ff925a61f9c62de7d64c64bad3' where user_id='1';
再次登录就 ok 了。

 

转载于:https://www.cnblogs.com/Jeely/p/11224310.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值