From 1525511e185cde921b462b16c3c1519d43c714be Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:29:58 +0800 Subject: [PATCH] url --- .../react/src/modules/courses/exercise/ExerciseNewCommon.js | 1 + public/react/src/modules/courses/exercise/new/ShixunEditor.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js index f2b6ae0cc..e69c44974 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js +++ b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js @@ -436,6 +436,7 @@ class ExerciseNewCommon extends Component{ getAddQuestionUrl: this.getAddQuestionUrl, getEditQuestionUrl: this.getEditQuestionUrl, + exercise_url: this.props.exercise_url, } return( diff --git a/public/react/src/modules/courses/exercise/new/ShixunEditor.js b/public/react/src/modules/courses/exercise/new/ShixunEditor.js index 1500e9be6..6457d256b 100644 --- a/public/react/src/modules/courses/exercise/new/ShixunEditor.js +++ b/public/react/src/modules/courses/exercise/new/ShixunEditor.js @@ -156,10 +156,10 @@ class ShixunEditor extends Component{ this.props.onEditorCancel() } componentDidMount = () => { - const { shixun_id } = this.props; + const { shixun_id, exercise_url } = this.props; // shixun_id const Id = this.props.match.params.Id - const url = `/exercises/${Id}/commit_shixun.json` + const url = `/${exercise_url || 'exercises'}/${Id}/commit_shixun.json` axios.get(url, { params: { shixun_id