|
@@ -47,12 +47,20 @@ class Graphql extends Component {
|
|
|
let group = data.project_by_id.apiGWGroup_id;
|
|
let group = data.project_by_id.apiGWGroup_id;
|
|
|
|
|
|
|
|
if (this.state.api === '') {
|
|
if (this.state.api === '') {
|
|
|
- let domain = group.userDomain? group.userDomain : (group.defaultDomain + '/' + group.environmentName);
|
|
|
|
|
- this.setState({
|
|
|
|
|
- api: group.frontType.slice(0, 4) + '://' + domain + '/graphql',
|
|
|
|
|
- show: true
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (group !== null) {
|
|
|
|
|
+ let domain = group.userDomain ? group.userDomain : (group.defaultDomain + '/' + group.environmentName);
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ api: group.frontType.slice(0, 4) + '://' + domain + '/graphql',
|
|
|
|
|
+ show: true
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ api: '尚未部署成功',
|
|
|
|
|
+ show: true
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div>
|
|
<div>
|
|
|
<Input
|
|
<Input
|
|
@@ -63,7 +71,7 @@ class Graphql extends Component {
|
|
|
this.setState({api: e.target.value})
|
|
this.setState({api: e.target.value})
|
|
|
}}/>
|
|
}}/>
|
|
|
{
|
|
{
|
|
|
- this.state.show?
|
|
|
|
|
|
|
+ this.state.show ?
|
|
|
<GraphiQL fetcher={this.graphQLFetcher}/>
|
|
<GraphiQL fetcher={this.graphQLFetcher}/>
|
|
|
:
|
|
:
|
|
|
''
|
|
''
|