From 78d7ad5f74eb9d9eaf398fe79ab6ab4d1f227515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 7 Sep 2019 13:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/usersInfo/InfosTopics.js | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 565f42a3d..db96818e5 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -84,36 +84,33 @@ class InfosTopics extends Component{ if(user_id===undefined){ - user_id=this.props.match.params&&this.props.match.params.username; + user_id=1 } - - if(user_id!=undefined){ - let {per_page}=this.state; - let url=`/users/${user_id}/question_banks.json`; - - axios.get(encodeURI(url),{params:{ - type, - object_type:category, - course_list_id, - sort_by, - sort_direction, - page, - per_page - } - }).then((response) => { - this.setState({ - data:response.data, - checkBoxValues:[], - isSpin:false - }) - }).catch((error) => { - this.setState({ - isSpin:false - }) - }); - } + let {per_page}=this.state; + let url=`/users/${user_id}/question_banks.json`; + + axios.get(encodeURI(url),{params:{ + type, + object_type:category, + course_list_id, + sort_by, + sort_direction, + page, + per_page + } + }).then((response) => { + this.setState({ + data:response.data, + checkBoxValues:[], + isSpin:false + }) + }).catch((error) => { + this.setState({ + isSpin:false + }) + }); }