Browse Source

fix url display

Csy817 7 years ago
parent
commit
e4563611fc
2 changed files with 5 additions and 6 deletions
  1. 4 5
      src/components/app/App.jsx
  2. 1 1
      src/components/common/schema/Create.js

+ 4 - 5
src/components/app/App.jsx

@@ -257,10 +257,9 @@ class App extends Component {
                                 key={locale ? locale.locale : 'en'/* Have to refresh for production environment */}>
                             <Switch>
                                 <Route path="/" exact component={TrialCase}/>
-                                <Route path="/graphql-service/:sidebar" component={TrialCase}/>
-                                <Route path="/wechat-service/:sidebar" component={WechatService}/>
+                                <Route path="/graphql-service/:sidebar/:case" component={TrialCase}/>
+                                <Route path="/wechat-service/:sidebar/:case" component={WechatService}/>
                                 <Route path="/quant-service/" component={QuantService}/>
-                                <Route path="/table" component={TrialCase}/>
                                 <Route path="/login" component={Login}/>
                                 <Redirect path="*" to="/"/>
                             </Switch>
@@ -339,7 +338,7 @@ class GraphqlSidebar extends Component {
                                         data.caseSchema.map((schema) =>
                                             <Menu.Item key={schema.schemaName}>
                                                 <Link to={{
-                                                    pathname: "/graphql-service/trial-case",
+                                                    pathname: `/graphql-service/trial-case/${schema.schemaName}`,
                                                     state:{
                                                         schemaName:schema.schemaName,
                                                         schemaID:schema.id
@@ -365,7 +364,7 @@ class GraphqlSidebar extends Component {
                                         data.userSchema.map((schema) =>
                                             <Menu.Item key={schema.schemaName}>
                                                 <Link to={{
-                                                    pathname: "/graphql-service/my-create",
+                                                    pathname: `/graphql-service/my-create/${schema.schemaName}`,
                                                     state:{
                                                         schemaName:schema.schemaName,
                                                         schemaID:schema.id

+ 1 - 1
src/components/common/schema/Create.js

@@ -61,7 +61,7 @@ class Create extends Component {
         this.props.hideModal();
         // this.props.history.push(`/table/${this.state.schemaName}?id=${varobj.id}`);
         this.props.history.push({
-            pathname: `/table`,
+            pathname: `/graphql-service/my-create/${this.state.schemaName}`,
             state:{
                 schemaName:this.state.schemaName,
                 schemaID:varobj.id,