mast_item_banktwo
杨树林 5 years ago
parent 0b6416d64e
commit 5e8df535cd

@ -1,7 +1,7 @@
/* /*
* @Description: 学员学习 * @Description: 学员学习
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-23 10:53:19 * @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-10 18:24:01 * @LastEditTime : 2020-02-10 18:24:01
@ -37,7 +37,7 @@ function StudentStudy (props) {
} = props; } = props;
const { const {
match: { params }, match: { params },
getUserProgramDetail, getUserProgramDetail,
saveUserProgramIdentifier saveUserProgramIdentifier
} = props; } = props;
@ -48,7 +48,18 @@ function StudentStudy (props) {
// 保存当前的id // 保存当前的id
saveUserProgramIdentifier(id); saveUserProgramIdentifier(id);
// startProgramQuestion(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); const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) { if ($searchs) {
const $params = $searchs.split('&') || []; const $params = $searchs.split('&') || [];
@ -110,7 +121,7 @@ function StudentStudy (props) {
props.clearOjForUserReducer(); props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit?{searchParams}`); props.history.push(`/problems/${identifier}/edit?{searchParams}`);
} }
// 处理退出 // 处理退出
const handleClickQuit = () => { const handleClickQuit = () => {
// 退出时,清空内容 // 退出时,清空内容
props.clearOjForUserReducer(); props.clearOjForUserReducer();
@ -136,9 +147,9 @@ function StudentStudy (props) {
</div> </div>
<div className={'study_quit'}> <div className={'study_quit'}>
{/* to={`/problems/${_hack_id}/edit`} */} {/* to={`/problems/${_hack_id}/edit`} */}
<span <span
style={{ display: userInfo.hack_manager ? 'inline-block' : 'none' }} style={{ display: userInfo.hack_manager ? 'inline-block' : 'none' }}
onClick={() => handleClickEditor(hack.identifier)} onClick={() => handleClickEditor(hack.identifier)}
className={`quit-btn`} className={`quit-btn`}
> >
<Icon type="form" className="quit-icon"/> 编辑 <Icon type="form" className="quit-icon"/> 编辑
@ -161,7 +172,7 @@ function StudentStudy (props) {
<LeftPane /> <LeftPane />
</div> </div>
<SplitPane split="vertical" defaultSize="100%" allowResize={false}> <SplitPane split="vertical" defaultSize="100%" allowResize={false}>
<RightPane <RightPane
updateNotice={handleUpdateNotice} updateNotice={handleUpdateNotice}
/> />
<div /> <div />
@ -182,7 +193,7 @@ const mapStateToProps = (state) => {
user_program_identifier, user_program_identifier,
hack_identifier, hack_identifier,
searchParams searchParams
}; };
}; };
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({

@ -154,4 +154,4 @@ export async function fetchQuestion (params) {
export async function fetchTagDisciplines (params) { export async function fetchTagDisciplines (params) {
const url = `/tag_disciplines.json`; const url = `/tag_disciplines.json`;
return axios.post(url, params); return axios.post(url, params);
} }

Loading…
Cancel
Save