Cross Shiro permission filtering

Cross Shiro permission filtering

Example

resources/spring/spring-context-shiro.xml
<!-- Shiro权限过滤过滤器定义 -->
<bean name="shiroFilterChainDefinitions" class="java.lang.String">
	<constructor-arg>
		<value>
			/static/** = anon
			......
			${adminPath}/act/task/trace2/** = anon
			......
		</value>
	</constructor-arg>
</bean>
@Controller
@RequestMapping(value = "${adminPath}/act/task")
public class ActTaskController extends BaseController {
    
    
	......
	@RequestMapping(value = "trace2/photo/{procDefId}/{execId}")
	public AjaxJson  tracePhoto2(@PathVariable("procDefId") String procDefId, @PathVariable("execId") String execId, HttpServletResponse response) throws Exception {
    
    
		AjaxJson j = new AjaxJson();
		j.setMsg("成功");
		return j;
	}
	......
}
http://localhost:8080/myweb/a/act/task/trace2/photo/b7...5e/0b...ee
header:......

Guess you like

Origin blog.csdn.net/mylearnbox/article/details/114080259