src/router/index.js
@@ -58,6 +58,7 @@ return (<item.component {...props}/>) } let userId = sessionStorage.getItem('UserID') // 判断登录信息是否存在,注用户可能保存主页链接 let authCode = localStorage.getItem(window.location.href.split('#')[0] + 'AuthCode') // 判断系统是否在授权期限内 let _s = md5('mksoft' + moment().format('YYYYMMDD')) let isauth = authCode && authCode.includes(_s) @@ -68,7 +69,7 @@ isauth = true } if (isauth) { if (userId && isauth) { return (<item.component {...props}/>) } else { return (<Redirect to={{ pathname: '/login'}}/>)