dev_auth
杨树林 5 years ago
parent 830bc21661
commit 07401a52cf

@ -289,8 +289,35 @@ class Registration extends React.Component {
}
} else {
try {
if (result.data.competition_teams.length === 0) {
if (this.props.user.admin === true) {
try {
if (result.data.competition_teams.length === 0) {
this.setState({
type: 6,
typeysl: 1,
data: result.data.competition_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count,
})
} else {
this.setState({
type: 6,
typeysl: 0,
data: result.data.competition_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count,
})
}
} catch (e) {
this.setState({
type: 6,
typeysl: 1,
@ -302,11 +329,40 @@ class Registration extends React.Component {
members_count: result.data.members_count,
})
} else {
}
} else {
try {
if (result.data.my_teams.length === 0) {
this.setState({
type: 6,
typeysl: 1,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count,
})
} else {
this.setState({
type: 6,
typeysl: 0,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count,
})
}
} catch (e) {
this.setState({
type: 6,
typeysl: 0,
data: result.data.competition_teams,
typeysl: 1,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
@ -315,19 +371,9 @@ class Registration extends React.Component {
})
}
} catch (e) {
this.setState({
type: 6,
typeysl: 1,
data: result.data.competition_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count,
})
}
}
}
}

Loading…
Cancel
Save