Parcourir la source

ide 切换 ok

xy il y a 7 ans
Parent
commit
ff727d6d73

+ 1 - 1
src/app/common/manage/Manage.jsx

@@ -36,7 +36,7 @@ class Manage extends Component {
 
     render() {
         const contentListNoTitle = {
-            tencent: <TencentResult userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase} switchMenu={this.props.switchMenu} switchAPI={this.props.switchAPI}/>,
+            tencent: <TencentResult userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase} switchMenu={this.props.switchMenu}/>,
             aliyun: <AliyunResult/>,
             amazon: <AmazonResult/>,
         };

+ 15 - 9
src/app/common/manage/TencentResult.js

@@ -25,6 +25,7 @@ class TencentResult extends Component {
                             return 'error!';
                         }
                         let group = data.project_by_id.apiGWGroup_id || {};
+                        let projectType = data.project_by_id.projectType || 'graphql';
                         return (
                             <div>
                                 {
@@ -75,8 +76,8 @@ class TencentResult extends Component {
                                                 <div className={'schema-name'}><FormattedMessage id='API manage'/></div>
                                                 <APIGWPathResult
                                                     group={group}
+                                                    projectType={projectType}
                                                     switchMenu={this.props.switchMenu}
-                                                    switchAPI={this.props.switchAPI}
                                                 />
                                             </div>
                                         </div>
@@ -157,7 +158,7 @@ class APIGWPathResult extends Component {
     }
 
     render() {
-        let {group} = this.props;
+        let {group, projectType} = this.props;
         let {id, frontType, defaultDomain, environmentName} = group;
         return (
             <Query query={gql(SHOW_APIGWPATH)} variables={{apiGWGroup_id: id}}>
@@ -203,13 +204,18 @@ class APIGWPathResult extends Component {
                                                             <Col span={3}>
                                                                 {/*<span className={'schema-table-content name'}>删除</span>*/}
                                                                 {/*&nbsp;*/}
-                                                                <span className={'schema-table-content name'}
-                                                                      onClick={() => {
-                                                                          this.props.switchMenu('menuLevel2', {key: 'graphiql'});
-                                                                          this.props.switchAPI(frontType.slice(0, 4) + '://' + defaultDomain +'/'+ environmentName +path.apiGWPath)
-                                                                      }}>
-                                                                    <FormattedMessage id='try'/>
-                                                                </span>
+                                                                {
+                                                                    projectType === 'graphql'?
+                                                                        <span className={'schema-table-content name'}
+                                                                              onClick={() => {
+                                                                                  this.props.switchMenu('menuLevel2', {key: 'graphiql'});
+                                                                              }}>
+                                                                            <FormattedMessage id='try'/>
+                                                                        </span>
+                                                                        :
+                                                                        ''
+                                                                }
+
                                                             </Col>
                                                         </Row>
                                                     </div>

+ 1 - 1
src/app/graphqlService/TrialCase.jsx

@@ -89,7 +89,7 @@ class TrialCase extends Component {
                                     case 'deploy':
                                         return <Deploy trialcase={true} userID={this.state.userID} projectID={projectID}/>;
                                     case 'manage':
-                                        return <Manage trialcase={true} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu} switchAPI={this.switchAPI}/>;
+                                        return <Manage trialcase={true} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu}/>;
                                     case 'graphiql':
                                         return <Graphql api={this.state.api} projectID={projectID}/>;
                                     case 'template':

+ 3 - 2
src/app/graphqlService/UserCreate.jsx

@@ -10,6 +10,7 @@ import Graphql from "./component/graphql/Graphql";
 import CaseMetabase from "./component/caseMetabase/CaseMetabase";
 import axios from 'axios';
 import {getIdUrl} from "../../config";
+import Application from "./component/application/Application";
 
 axios.defaults.withCredentials = true;
 
@@ -84,7 +85,7 @@ class UserCreate extends Component {
                                     case 'deploy':
                                         return <Deploy trialcase={false} userID={this.state.userID} projectID={projectID}/>;
                                     case 'manage':
-                                        return <Manage trialcase={false} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu} switchAPI={this.switchAPI}/>;
+                                        return <Manage trialcase={false} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu}/>;
                                     case 'graphiql':
                                         return <Graphql api={this.state.api} projectID={projectID}/>;
                                     case 'template':
@@ -92,7 +93,7 @@ class UserCreate extends Component {
                                     case 'metabase':
                                         return <CaseMetabase/>;
                                     default:
-                                        return <Graphql/>;
+                                        return <Application location={this.props.location}/>;
                                 }
                             })()
                         }

+ 2 - 2
src/app/graphqlService/component/graphql/Graphql.jsx

@@ -46,10 +46,10 @@ class Graphql extends Component {
                         }
                         let group = data.project_by_id.apiGWGroup_id;
                         if (this.state.api === '') {
-                            let domain = group.userDomain? group.userDomain : group.defaultDomain;
+                            let domain = group.userDomain? group.userDomain : group.defaultDomain + '/' + group.environmentName;
                             this.setState({
                                 // 多路径没做
-                                api: group.frontType.slice(0, 4) + '://' + domain +'/'+ group.environmentName + '/graphql',
+                                api: group.frontType.slice(0, 4) + '://' + domain + '/graphql',
                                 show: true
                             })
                         }

+ 3 - 3
src/app/wechatService/WxTrialCase.js

@@ -53,11 +53,11 @@ class WxTrialCase extends Component {
                         {(() => {
                             switch (this.state.menuLevel3) {
                                 case 'wechat-config':
-                                    return <WxConfig projectID={projectID} defaultAppName={'ecommerce'} defaultConfigID={'ecommerce_wxConfigID'} trialcase={true} history={this.props.history} location={this.props.location}/>;
+                                    return <WxConfig trialcase={true} userID={this.state.userID} projectID={projectID} defaultAppName={'ecommerce'} defaultConfigID={'ecommerce_wxConfigID'} history={this.props.history} location={this.props.location}/>;
                                 case 'wechat-deploy':
-                                    return <WxDeploy projectID={projectID} trialcase={true} userID={this.state.userID}/>;
+                                    return <WxDeploy trialcase={true} userID={this.state.userID} projectID={projectID}/>;
                                 case 'wechat-manage':
-                                    return <Manage projectID={projectID} trialcase={true} userID={this.state.userID} switchMenu={this.switchMenu}/>;
+                                    return <Manage trialcase={true} userID={this.state.userID} projectID={projectID}/>;
                                 default:
                                     return <WxConfig/>
                             }

+ 3 - 3
src/app/wechatService/WxUserCreate.js

@@ -75,11 +75,11 @@ class WxUserCreate extends Component {
                         {(() => {
                             switch (this.state.menuLevel3) {
                                 case 'wechat-config':
-                                    return <WxConfig projectID={projectID}  userID={this.state.userID} history={this.props.history} location={this.props.location}/>;
+                                    return <WxConfig trialcase={false} userID={this.state.userID} projectID={projectID} history={this.props.history} location={this.props.location}/>;
                                 case 'wechat-deploy':
-                                    return <WxDeploy projectID={projectID} trialcase={false} userID={this.state.userID} />;
+                                    return <WxDeploy trialcase={false} userID={this.state.userID} projectID={projectID}/>;
                                 case 'wechat-manage':
-                                    return <Manage projectID={projectID} trialcase={false} userID={this.state.userID} switchMenu={this.switchMenu}/>;
+                                    return <Manage trialcase={false} userID={this.state.userID} projectID={projectID}/>;
                                 default:
                                     return <WxConfig/>
                             }