From 66b2f7a5bb1b362dbf9d425faeea52e45f21d2f1 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Sun, 28 Nov 2021 17:43:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AE=A2=E5=8D=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/home.js | 2 +- src/pages/system/account/list/list.js | 34 +++++++++++++-------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/pages/home/home.js b/src/pages/home/home.js index efba4522..b3d3700a 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=>{ diff --git a/src/pages/system/account/list/list.js b/src/pages/system/account/list/list.js index d5080f85..3ce6d86a 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){ From ba6c1f3fa6b5d43ba4c84cc4ba5a55a10e88ccfb Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Sun, 28 Nov 2021 17:52:45 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3token=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assets/api.js b/src/assets/api.js index cd6669d4..1f8761d6 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -96,8 +96,9 @@ const req = (method, url, params, responseType) => { case 401: Notify.clear(); Notify.error( "当前信息过期请重新登录"); + sessionStorage.clear(); setTimeout(() => { - window.location.href='./login'; + window.location.href='/login'; }, 3000) break; } From 537690bfb4af0506eef8ffdd480e875fc9b2abe9 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Sun, 28 Nov 2021 18:01:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3token=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 6 +++--- src/pages/home/home.js | 26 +++++++++++++------------- src/pages/system/account/list/list.js | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) 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'}/>

Date: Sun, 28 Nov 2021 18:34:00 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/distributor/list/list.js | 3 +-- src/pages/exchangecode/list/list.js | 3 +-- src/pages/exchangepage/mytemplate/main.js | 18 ++++++++++++++++-- src/pages/system/account/list/list.js | 3 +-- src/pages/system/role/list/list.js | 3 +-- 5 files changed, 20 insertions(+), 10 deletions(-) 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/system/account/list/list.js b/src/pages/system/account/list/list.js index 4e3528fb..ecb251cc 100644 --- a/src/pages/system/account/list/list.js +++ b/src/pages/system/account/list/list.js @@ -219,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)=>{ }) diff --git a/src/pages/system/role/list/list.js b/src/pages/system/role/list/list.js index 22be5b9e..59b7c024 100644 --- a/src/pages/system/role/list/list.js +++ b/src/pages/system/role/list/list.js @@ -53,8 +53,7 @@ export default class acclist extends React.Component{ const roleList_data=response.data; const {total}=response; _self.setState({roleList:roleList_data,total}); - Notify.clear(); - Notify.success(msg); + }) }) }