引用JS报错:uncaught syntaxerror: unexpected token <

来源:互联网 发布:保险从业人员数据 编辑:程序博客网 时间:2024/06/05 01:40

框架:springmvc+easyui+shiro

session超时,发现页面跳转有问题,部分窗口跳转,于是本地做测试

1.本地web.xml配置session超时:2min

 <session-config>   <session-timeout>2</session-timeout> </session-config>

2.在登录页面引用js,并且做跳转
<script type="text/javascript" src="${baseurl}js/jquery.min.js"></script><script type="text/javascript">$(function(){if (window != top) top.location.href = location.href; });</script>

3.引用不生效,报错uncaught syntaxerror: unexpected token < 

   错误原因无非是引用文件出现问题,最终发现原来是shiro授权出了问题;如下,配置(/js/**=anon)即可  

<!-- url访问策略 【URL级别权限控制】 --><property name="filterChainDefinitions"><value>/login.* = anon/delivery/**=anon/images/**=anon/styles/**=anon/batch/**=anon/css/**=anon/js/**=anon                   /** = authc</value></property>

0 0
原创粉丝点击