Commit 206faf52 by FE

to level test add version

parent 29ebb3a6
......@@ -50,18 +50,16 @@ class LevelTest extends Component {
}
startTest = () => {
const {history, isLogin, toLogin} = this.props;
const {isLogin, toLogin} = this.props;
if(isLogin) {
// history.push('/levelTest/test');
// if(getParam('version')) {
if(getParam('version')) {
window.location.href = `${API.m}/levelTest/test?version=${getParam('version')}`;
}else{
window.location.href = `${API.m}/levelTest/test`;
// }else{
// history.push('/levelTest/test');
// }
}
}else{
toLogin();
}
}
render() {
......
......@@ -21,6 +21,15 @@ export default class RecordPopup extends Component {
});
}
handleToTestRecord = (e, id) => {
e.preventDefault();
if(getParam('version')) {
history.push(`/levelTest/report?id=${id}&version=${getParam('version')}`)
} else {
history.push(`/levelTest/report?id=${id}`)
}
}
render() {
let {recordList} = this.state;
......@@ -49,7 +58,7 @@ export default class RecordPopup extends Component {
<span className="tr">
{
index === 0 ? (
<a href={`/levelTest/report?id=${item.id}`}>测试记录</a>
<a onClick={(e) => this.handleToTestRecord(e, item.id)}>测试记录</a>
) : (null)
}
</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment