diff --git a/src/assets/api.js b/src/assets/api.js index cd6669d4..eeef1236 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -87,18 +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) + window.location.href='/login'; + }, 2000) break; } } diff --git a/src/pages/distributor/list/list.js b/src/pages/distributor/list/list.js index 915fc71c..e7e85845 100644 --- a/src/pages/distributor/list/list.js +++ b/src/pages/distributor/list/list.js @@ -262,8 +262,7 @@ export default class acclist extends React.Component{ const reseller_data=response.data; const {total}=response; _self.setState({resellerList:reseller_data,total}); - Notify.clear(); - Notify.success(msg); + },err=>{ }); }).catch(err=>{ diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 014609e1..466500ed 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -303,8 +303,7 @@ export default class acclist extends React.Component{ const codeList_data=response.data; const {total}=response; _self.setState({codeList:codeList_data,total}); - Notify.clear(); - Notify.success(msg); + },(err)=>{ }) diff --git a/src/pages/exchangepage/mytemplate/main.js b/src/pages/exchangepage/mytemplate/main.js index c2df50ed..b89365dd 100644 --- a/src/pages/exchangepage/mytemplate/main.js +++ b/src/pages/exchangepage/mytemplate/main.js @@ -127,13 +127,27 @@ componentWillMount(){ } this.getTableList(data); } + + //limit + countChange(e){ + this.setState({page:1,limit:e}); + let data = { + page:e, + limit:this.state.limit + } + + this.getTableList(data); + } + pageChange(e){ this.setState({page:e}) let data = { page:e, limit:this.state.limit - - } + } + if(this.state.key_word){ + data.title=this.state.key_word; + } this.getTableList(data); } diff --git a/src/pages/home/home.js b/src/pages/home/home.js index efba4522..7c171325 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -181,7 +181,7 @@ export default class App extends Component { Notify.clear(); Notify.success('退出成功!'); sessionStorage.clear(); - },2000); + },100); } }).catch(err=>{ @@ -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 d5080f85..ecb251cc 100644 --- a/src/pages/system/account/list/list.js +++ b/src/pages/system/account/list/list.js @@ -98,24 +98,9 @@ export default class acclistDom extends React.Component{ } ]}] sessionStorage.setItem('breaknav',JSON.stringify(activerou)); - this.getCompanyFn(); + } - //获取公司 - getCompanyFn(){ - let _self=this; - getCompany().then(res=>{ - handelResponse(res,(response,msg)=>{ - let companyList=response.map(item=>{ - return {key:item.id,text:item.company_name} - }); - sessionStorage.setItem('company',JSON.stringify(companyList)); - - },(err)=>{ - }) - }).catch(err=>{ - }); -} onChange = options => { this.setState(options); }; @@ -188,7 +173,19 @@ export default class acclistDom extends React.Component{ }); } editFn(e,row){ - + let _self=this; + getCompany().then(res=>{ + handelResponse(res,(response,msg)=>{ + let companyList=response.map(item=>{ + return {key:item.id,text:item.company_name} + }); + sessionStorage.setItem('company',JSON.stringify(companyList)); + this.props.history.push('/home/system/account-add'); + },(err)=>{ + + }) + }).catch(err=>{ + }); sessionStorage.setItem('pathname2','/home/system/account-add') let activerou=[{'pagetitle':'编辑',items:[ { @@ -200,9 +197,10 @@ export default class acclistDom extends React.Component{ "name": "编辑账号" } ]}] + sessionStorage.setItem('breaknav',JSON.stringify(activerou)); sessionStorage.setItem('dataInfo',JSON.stringify(row)); - this.props.history.push('/home/system/account-add'); + } //重置密码 resetpwd(e,row){ @@ -221,8 +219,7 @@ export default class acclistDom extends React.Component{ const accList_data=response.data; const {total}=response; _self.setState({accList:accList_data,total}); - Notify.clear(); - Notify.success(msg); + },(err)=>{ }) @@ -284,7 +281,7 @@ componentDidUpdate(prevProps,prevState){
{/* */}
-