From 5e8df535cd1bb1e8cf83b34e64615bbd1cb1ea0a 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 | 27 +++++++++++++------ public/react/src/services/ojService.js | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index 184ce0af5..2af70efdf 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 @@ -37,7 +37,7 @@ function StudentStudy (props) { } = props; const { - match: { params }, + match: { params }, getUserProgramDetail, saveUserProgramIdentifier } = props; @@ -48,7 +48,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('&') || []; @@ -110,7 +121,7 @@ function StudentStudy (props) { props.clearOjForUserReducer(); props.history.push(`/problems/${identifier}/edit?{searchParams}`); } - // 处理退出 + // 处理退出 const handleClickQuit = () => { // 退出时,清空内容 props.clearOjForUserReducer(); @@ -136,9 +147,9 @@ function StudentStudy (props) {