From 7fe94de465a733d3d5c959e4c6a85c6aeffff7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 27 Feb 2020 16:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/developer/studentStudy/index.js | 19 +++++++++++++++---- public/react/src/services/ojService.js | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index d40269e7c..7abf93841 100644 --- a/public/react/src/modules/developer/studentStudy/index.js +++ b/public/react/src/modules/developer/studentStudy/index.js @@ -1,7 +1,7 @@ /* * @Description: 学员学习 * @Author: tangjiang - * @Github: + * @Github: * @Date: 2019-11-23 10:53:19 * @LastEditors : tangjiang * @LastEditTime : 2020-02-10 18:24:01 @@ -45,7 +45,18 @@ function StudentStudy(props) { // 保存当前的id saveUserProgramIdentifier(id); // startProgramQuestion(id); - getUserProgramDetail(id); + // console.log("getUserProgramDetail(id)"); + // console.log(id); + // console.log(id.charAt(id.length-1)); + try { + if(id.charAt(id.length-1)==="?"){ + id = id.substring(0, id.length - 1); + } + }catch (e) { + + } + + getUserProgramDetail(id); const $searchs = window.location.search && window.location.search.substring(1); if ($searchs) { const $params = $searchs.split('&') || []; @@ -107,7 +118,7 @@ function StudentStudy(props) { props.clearOjForUserReducer(); props.history.push(`/problems/${identifier}/edit?{searchParams}`); } - // 处理退出 + // 处理退出 const handleClickQuit = () => { // 退出时,清空内容 props.clearOjForUserReducer(); @@ -179,7 +190,7 @@ const mapStateToProps = (state) => { user_program_identifier, hack_identifier, searchParams - }; + }; }; const mapDispatchToProps = (dispatch) => ({ diff --git a/public/react/src/services/ojService.js b/public/react/src/services/ojService.js index d0d0ae0ae..806364ef4 100644 --- a/public/react/src/services/ojService.js +++ b/public/react/src/services/ojService.js @@ -154,4 +154,4 @@ export async function fetchQuestion (params) { export async function fetchTagDisciplines (params) { const url = `/tag_disciplines.json`; return axios.post(url, params); -} \ No newline at end of file +}