diff --git a/src/assets/api.js b/src/assets/api.js index 1f8761d6..eeef1236 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -87,19 +87,19 @@ const req = (method, url, params, responseType) => { let http = fetch(url, obj).then(res =>{ window.timeshow=res.headers.get('Date-Time'); - console.log(res); if(res.status==200){ return res.json() }else{ + console.log(res); switch (res.status) { // 401: 未登录 case 401: Notify.clear(); - Notify.error( "当前信息过期请重新登录"); + Notify.error( "没有权限,用户登录已失效"); sessionStorage.clear(); setTimeout(() => { window.location.href='/login'; - }, 3000) + }, 2000) break; } } diff --git a/src/pages/home/home.js b/src/pages/home/home.js index b3d3700a..7c171325 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -203,20 +203,20 @@ export default class App extends Component { window.document.addEventListener('mouseover',function(){ window["mydata"].setState({lastTime:new Date().getTime()}); //更新操作时间 }); - timerstop=window.setInterval( window["mydata"].testTime, 1000); - } - testTime(){ - window["mydata"].setState({'currentTime':new Date().getTime()});//更新当前时间 - if( window["mydata"].state.currentTime - window["mydata"].state.lastTime > window["mydata"].state.timeOut){ //判断是否超时 - window.clearInterval(timerstop) - Notify.clear() - Notify.warn('登录失效,请重新登录!') - sessionStorage.clear(); - setTimeout(()=>{ - window["mydata"].props.history.push('/login'); - },5000); - } + // timerstop=window.setInterval( window["mydata"].testTime, 1000); } + // testTime(){ + // window["mydata"].setState({'currentTime':new Date().getTime()});//更新当前时间 + // if( window["mydata"].state.currentTime - window["mydata"].state.lastTime > window["mydata"].state.timeOut){ //判断是否超时 + // window.clearInterval(timerstop) + // Notify.clear() + // Notify.warn('登录失效,请重新登录!') + // sessionStorage.clear(); + // setTimeout(()=>{ + // window["mydata"].props.history.push('/login'); + // },5000); + // } + // } componentWillReceiveProps(nextProps) { if (this.state.noShowSubMenu.indexOf(nextProps.location.pathname) > -1 ) { console.log("不展示") diff --git a/src/pages/system/account/list/list.js b/src/pages/system/account/list/list.js index 3ce6d86a..4e3528fb 100644 --- a/src/pages/system/account/list/list.js +++ b/src/pages/system/account/list/list.js @@ -282,7 +282,7 @@ componentDidUpdate(prevProps,prevState){

{/* */} - this.setState({search:e})} value={this.state.search} wordSearch={this.iptsureFn.bind(this)} icon="search" placeholder={"请输入手机号、账号查询"} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{this.setState({search:''})}} alignment={'left'}/> + this.setState({search:e})} value={this.state.search} wordSearch={this.iptsureFn.bind(this)} icon="search" placeholder={"请输入姓名、手机号、账号查询"} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{this.setState({search:''})}} alignment={'left'}/>