diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
index f15141480..8e7b0b93a 100644
--- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
+++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
@@ -41,17 +41,16 @@ export default class TPMsettings extends Component {
axios.get(Url).then((response) => {
// alert(response.data.shixun.choice_standard_scripts)
if (response.status === 200) {
-
+ if (response.data.shixun.scope_partment) {
+ if (response.data.shixun.scope_partment.length > 0) {
+ this.setState({
+ scopetype: true
+ })
+ }
+ }
this.setState({
data: response.data
})
-
- if (response.data.shixun.scope_partment.length > 0) {
- this.setState({
- scopetype: true
- })
- }
-
}
});
@@ -96,7 +95,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false,
});
- window.location.href = "/shixuns";
+ // window.location.href = "/shixuns";
+ this.props.history.replace( "/shixuns/");
}
}).catch((error) => {
console.log(error)
@@ -113,7 +113,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false,
});
- window.location.href = "/shixuns/" + id + "/challenges";
+ // window.location.href = "/shixuns/" + id + "/challenges";
+ this.props.history.replace( "/shixuns/" + id + "/challenges");
}
}).catch((error) => {
console.log(error)
@@ -128,7 +129,7 @@ export default class TPMsettings extends Component {
render() {
- let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置"
+ let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置"
// let a="isvnc";
// let b="isVNC";
@@ -197,7 +198,7 @@ export default class TPMsettings extends Component {
getdatas={(key) => this.getdatas(key)}
/>
- {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ?
+ {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false ?