From fa7e7426aabf25c16bb6ee3600bec366db73a90c Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 27 Dec 2019 18:51:29 +0800 Subject: [PATCH] update style --- .../studentStudy/leftpane/taskDescription/index.js | 10 ++++++---- public/react/src/redux/actions/ojForm.js | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js b/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js index f99d59092..ebc42b9a4 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:30 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 14:50:37 + * @LastEditTime : 2019-12-27 18:42:59 */ import '../index.scss'; import React from 'react'; @@ -18,7 +18,7 @@ const {tagBackground, diffText} = CONST; const TaskDescription = (props) => { - const { hack = {} } = props; + const { hack = {}, userInfo = {} } = props; const {language, difficult, time_limit, username, description} = hack; return (
@@ -37,7 +37,7 @@ const TaskDescription = (props) => {

出题者: - {username} + {username}

@@ -52,8 +52,10 @@ const TaskDescription = (props) => { const mapStateToProps = (state) => { const { hack } = state.ojForUserReducer; + const { userInfo } = state.userReducer; return { - hack + hack, + userInfo } } diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 9cd4e8228..094257f42 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-27 14:18:02 + * @LastEditTime : 2019-12-27 18:50:22 */ import types from './actionTypes'; import CONST from '../../constants'; @@ -297,6 +297,9 @@ export const validateOjForm = (props, type, cb) => { type: types.SAVE_OJ_FORM_ID, payload: identifier }); + if (paramsObj['submitType'] === 'add' && identifier) { + props.history.push(`/problems/${identifier}/edit`) + }; } // 保存或更新后,调用start接口 // linkToDev(dispatch, props);