一:获取项目名称(如:‘cdjzzjfglmh’)
(function(){ var contextPath="<%=request.getSession().getServletContext().getContextPath()%>"; window.$$ = function(uri) { return (contextPath+"/"+uri).replace(//{2}/, '/'); }; window.filePath=window.uir = contextPath+"/static/portalSite"; })(); console.log(window.$$('personal/showEvidence')); //cdjzzjfglmh/personal/showEvidence console.log(window.$$(URL路径);