Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/app/App.jsx
#	src/app/graphqlService/TrialCase.jsx
#	src/app/wechatService/WxTrialCase.js
#	src/language/en_US.js
#	src/language/zh_CN.js
#	src/login/CloudConfig.js
#	src/login/LoginInput.js
Csy817 7 лет назад
Родитель
Сommit
8cee9b2a8e

+ 106 - 76
src/app/common/deploy/Deploy.jsx

@@ -1,5 +1,5 @@
 import React, {Component} from 'react';
-import {Card, Input} from 'antd';
+import {Card, Spin} from 'antd';
 
 import TencentConfig from './tencent/TencentConfig';
 import AliConfig from './ali/AliConfig';
@@ -8,20 +8,24 @@ import AmazonConfig from './amazon/AmazonConfig';
 import './index.css';
 import {SHOW_FC_SCHEMA, SHOW_FC_CONFIG, SEARCH_SCHEMA, SHOW_CLOUD, SHOW_WXCONTENT} from "../../../gql";
 import {request} from 'graphql-request'
-
 import {graphqlUrl} from "../../../config";
 
 const tabListNoTitle = [{
     key: 'tencent',
     tab: 'Tencent',
-}, {
-    key: 'aliyun',
-    tab: 'Aliyun',
-}, {
-    key: 'amazon',
-    tab: 'AWS',
 }];
 
+// [{
+//     key: 'tencent',
+//     tab: 'Tencent',
+// }, {
+//     key: 'aliyun',
+//     tab: 'Aliyun',
+// }, {
+//     key: 'amazon',
+//     tab: 'AWS',
+// }];
+
 
 class Deploy extends Component {
     constructor(props) {
@@ -50,6 +54,8 @@ class Deploy extends Component {
         }, this.fetch)
     }
 
+
+
     fetch = () => {
         if (this.state.schemaID !== '' && this.state.schemaID !== undefined) {
             request(graphqlUrl, SHOW_FC_SCHEMA, {schema_id: this.state.schemaID}).then(
@@ -62,39 +68,51 @@ class Deploy extends Component {
                                 // 如果没有 fc,根据 userID 查 cloudId
                                 request(graphqlUrl, SHOW_CLOUD, {user_id: this.props.userID}).then(
                                     __data => {
-                                        __data.cloud_by_props.forEach(cloud => {
-                                            switch (cloud.cloudName) {
-                                                case 'tencent':
-                                                    this.setState({
-                                                        tencentFC: false,
-                                                        tencentCloudID: cloud.id,
-                                                        defalutName: _data.schema_by_id.schemaName,
-                                                        show: true,
-                                                        kind: 'graphql'
-                                                    });
-                                                    break;
-                                                case 'aliyun':
-                                                    this.setState({
-                                                        aliyunFC: false,
-                                                        aliyunCloudID: cloud.id,
-                                                        defalutName: _data.schema_by_id.schemaName,
-                                                        show: true,
-                                                        kind: 'graphql'
-                                                    });
-                                                    break;
-                                                case 'amazon':
-                                                    this.setState({
-                                                        amazonFC: false,
-                                                        amazonCloudID: cloud.id,
-                                                        defalutName: _data.schema_by_id.schemaName,
-                                                        show: true,
-                                                        kind: 'graphql'
-                                                    });
-                                                    break;
-                                                default:
-                                                    break;
-                                            }
-                                        })
+                                        // 如果 user 未设置 cloudID
+                                        if(__data.cloud_by_props.length === 0) {
+                                            this.setState({
+                                                tencentFC: false,
+                                                aliyunFC: false,
+                                                amazonFC: false,
+                                                defalutName: _data.schema_by_id.schemaName,
+                                                show: true,
+                                                kind: 'graphql'
+                                            });
+                                        } else {
+                                            __data.cloud_by_props.forEach(cloud => {
+                                                switch (cloud.cloudName) {
+                                                    case 'tencent':
+                                                        this.setState({
+                                                            tencentFC: false,
+                                                            tencentCloudID: cloud.id,
+                                                            defalutName: _data.schema_by_id.schemaName,
+                                                            show: true,
+                                                            kind: 'graphql'
+                                                        });
+                                                        break;
+                                                    case 'aliyun':
+                                                        this.setState({
+                                                            aliyunFC: false,
+                                                            aliyunCloudID: cloud.id,
+                                                            defalutName: _data.schema_by_id.schemaName,
+                                                            show: true,
+                                                            kind: 'graphql'
+                                                        });
+                                                        break;
+                                                    case 'amazon':
+                                                        this.setState({
+                                                            amazonFC: false,
+                                                            amazonCloudID: cloud.id,
+                                                            defalutName: _data.schema_by_id.schemaName,
+                                                            show: true,
+                                                            kind: 'graphql'
+                                                        });
+                                                        break;
+                                                    default:
+                                                        break;
+                                                }
+                                            })
+                                        }
                                     }
                                 );
                             } else {
@@ -145,39 +163,51 @@ class Deploy extends Component {
                                 // 如果没有 fc,根据 userID 查 cloudId
                                 request(graphqlUrl, SHOW_CLOUD, {user_id: this.props.userID}).then(
                                     __data => {
-                                        __data.cloud_by_props.forEach(cloud => {
-                                            switch (cloud.cloudName) {
-                                                case 'tencent':
-                                                    this.setState({
-                                                        tencentFC: false,
-                                                        tencentCloudID: cloud.id,
-                                                        defalutName: _data.wxConfig_by_id.appName,
-                                                        show: true,
-                                                        kind: 'wx'
-                                                    });
-                                                    break;
-                                                case 'aliyun':
-                                                    this.setState({
-                                                        aliyunFC: false,
-                                                        aliyunCloudID: cloud.id,
-                                                        defalutName: _data.wxConfig_by_id.appName,
-                                                        show: true,
-                                                        kind: 'wx'
-                                                    });
-                                                    break;
-                                                case 'amazon':
-                                                    this.setState({
-                                                        amazonFC: false,
-                                                        amazonCloudID: cloud.id,
-                                                        defalutName: _data.wxConfig_by_id.appName,
-                                                        show: true,
-                                                        kind: 'wx'
-                                                    });
-                                                    break;
-                                                default:
-                                                    break;
-                                            }
-                                        })
+                                        // 如果 user 未设置 cloudID
+                                        if(__data.cloud_by_props.length === 0) {
+                                            this.setState({
+                                                tencentFC: false,
+                                                aliyunFC: false,
+                                                amazonFC: false,
+                                                defalutName: _data.wxConfig_by_id.appName,
+                                                show: true,
+                                                kind: 'wx'
+                                            });
+                                        } else {
+                                            __data.cloud_by_props.forEach(cloud => {
+                                                switch (cloud.cloudName) {
+                                                    case 'tencent':
+                                                        this.setState({
+                                                            tencentFC: false,
+                                                            tencentCloudID: cloud.id,
+                                                            defalutName: _data.wxConfig_by_id.appName,
+                                                            show: true,
+                                                            kind: 'wx'
+                                                        });
+                                                        break;
+                                                    case 'aliyun':
+                                                        this.setState({
+                                                            aliyunFC: false,
+                                                            aliyunCloudID: cloud.id,
+                                                            defalutName: _data.wxConfig_by_id.appName,
+                                                            show: true,
+                                                            kind: 'wx'
+                                                        });
+                                                        break;
+                                                    case 'amazon':
+                                                        this.setState({
+                                                            amazonFC: false,
+                                                            amazonCloudID: cloud.id,
+                                                            defalutName: _data.wxConfig_by_id.appName,
+                                                            show: true,
+                                                            kind: 'wx'
+                                                        });
+                                                        break;
+                                                    default:
+                                                        break;
+                                                }
+                                            })
+                                        }
                                     }
                                 );
                             } else {
@@ -222,7 +252,7 @@ class Deploy extends Component {
 
     render() {
         const contentListNoTitle = {
-            tencent: <TencentConfig cloudID={this.state.tencentCloudID} fc={this.state.tencentFC} defalutName={this.state.defalutName} userID={this.props.userID} kind={this.state.kind}/>,
+            tencent: <TencentConfig cloudID={this.state.tencentCloudID} fc={this.state.tencentFC} defalutName={this.state.defalutName} userID={this.props.userID} kind={this.state.kind} trialcase={this.props.trialcase}/>,
             aliyun: <AliConfig/>,
             amazon: <AmazonConfig/>,
         };
@@ -244,7 +274,7 @@ class Deploy extends Component {
                             this.state.show ?
                                 contentListNoTitle[this.state.cloud]
                                 :
-                                "waiting, if long, checkout your internet or did u forget cloud id and secret config when login"
+                                <Spin/>
                         }
                     </Card>
                 </div>

+ 32 - 9
src/app/common/deploy/tencent/APIGroupCard.js

@@ -4,7 +4,8 @@ import {ADD_APIGROUP, UPDATE_APIGROUP} from "../../../../gql";
 import {request} from 'graphql-request'
 import {idGen} from "../../../../func";
 import {graphqlUrl} from "../../../../config";
-
+import {manageUsers} from "../../../../config";
+import {FormattedMessage} from 'react-intl';
 const Panel = Collapse.Panel;
 
 
@@ -196,16 +197,38 @@ class APIGroupCard extends Component {
                         </div>
                     </Panel>
                 </Collapse>
-                <Button onClick={()=>{
-                    const id = idGen('group');
-                    this.ok(id);
-                    this.props.pass(id, 'group');
-                }} type='primary'>ok</Button>
                 {
-                    this.state.showOK === true?
-                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                    manageUsers.includes(this.props.userID)?
+                        <div>
+                            <Button onClick={()=>{
+                                const id = idGen('group');
+                                this.ok(id);
+                                this.props.pass(id, 'group');
+                            }} type='primary'>save</Button>
+                            {
+                                this.state.showOK === true?
+                                    <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                    :
+                                    ''
+                            }
+                        </div>
                         :
-                        ''
+                        this.props.trialcase?
+                            ''
+                            :
+                            <div>
+                                <Button onClick={()=>{
+                                    const id = idGen('group');
+                                    this.ok(id);
+                                    this.props.pass(id, 'group');
+                                }} type='primary'>save</Button>
+                                {
+                                    this.state.showOK === true?
+                                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                        :
+                                        ''
+                                }
+                            </div>
                 }
             </div>
         )

+ 24 - 4
src/app/common/deploy/tencent/APIPathCard.js

@@ -4,6 +4,7 @@ import {request} from 'graphql-request'
 import {ADD_APIGWPATH, UPDATE_APIGWPATH} from "../../../../gql";
 import {idGen} from "../../../../func";
 import {graphqlUrl} from "../../../../config";
+import {manageUsers} from "../../../../config";
 
 const Panel = Collapse.Panel;
 
@@ -150,13 +151,32 @@ class APIPathCard extends Component {
                         </div>
                     </Panel>
                 </Collapse>
-                <Button onClick={this.ok} type='primary'>ok</Button>
                 {
-                    this.state.showOK === true?
-                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                    manageUsers.includes(this.props.userID) ?
+                        <div>
+                            <Button onClick={this.ok} type='primary'>save</Button>
+                            {
+                                this.state.showOK === true?
+                                    <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                    :
+                                    ''
+                            }
+                        </div>
                         :
-                        ''
+                        this.props.trialcase?
+                            ''
+                            :
+                            <div>
+                                <Button onClick={this.ok} type='primary'>save</Button>
+                                {
+                                    this.state.showOK === true?
+                                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                        :
+                                        ''
+                                }
+                            </div>
                 }
+
             </div>
         )
     }

+ 33 - 11
src/app/common/deploy/tencent/DeployCard.js

@@ -4,11 +4,11 @@ import {ADD_DEPLOY, UPDATE_DEPLOY} from "../../../../gql";
 import {request} from 'graphql-request'
 import {idGen} from "../../../../func";
 import {graphqlUrl} from "../../../../config";
+import {manageUsers} from "../../../../config";
 
 const Panel = Collapse.Panel;
 
 
-
 class DeployCard extends Component {
     constructor(props) {
         super(props);
@@ -108,7 +108,7 @@ class DeployCard extends Component {
                             showOK: true
                         })
                     }
-                    setTimeout(()=>{
+                    setTimeout(() => {
                         this.setState({
                             showOK: false
                         })
@@ -136,7 +136,7 @@ class DeployCard extends Component {
                             showOK: true
                         })
                     }
-                    setTimeout(()=>{
+                    setTimeout(() => {
                         this.setState({
                             showOK: false
                         })
@@ -204,16 +204,38 @@ class DeployCard extends Component {
                         }
                     </Panel>
                 </Collapse>
-                <Button onClick={()=>{
-                    const id = idGen('deploy');
-                    this.ok(id);
-                    this.props.pass(id, 'deploy');
-                }} type='primary'>ok</Button>
                 {
-                    this.state.showOK === true?
-                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                    manageUsers.includes(this.props.userID) ?
+                        <div>
+                            <Button onClick={() => {
+                                const id = idGen('deploy');
+                                this.ok(id);
+                                this.props.pass(id, 'deploy');
+                            }} type='primary'>save</Button>
+                            {
+                                this.state.showOK === true ?
+                                    <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                    :
+                                    ''
+                            }
+                        </div>
                         :
-                        ''
+                        this.props.trialcase ?
+                            ''
+                            :
+                            <div>
+                                <Button onClick={() => {
+                                    const id = idGen('deploy');
+                                    this.ok(id);
+                                    this.props.pass(id, 'deploy');
+                                }} type='primary'>save</Button>
+                                {
+                                    this.state.showOK === true ?
+                                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                        :
+                                        ''
+                                }
+                            </div>
                 }
             </div>
         )

+ 15 - 3
src/app/common/deploy/tencent/NotificationCard.js

@@ -1,5 +1,6 @@
 import React, {Component} from 'react';
 import {Input, Tooltip, Icon, Button} from 'antd';
+import {manageUsers} from "../../../../config";
 
 class NotificationCard extends Component {
 
@@ -53,9 +54,20 @@ class NotificationCard extends Component {
                     {/*</div>*/}
                 {/*</div>*/}
 
-                <Button type="primary" onClick={() => {
-                    console.log('hello');
-                }}>save</Button>
+                {
+                    manageUsers.includes(this.props.userID) ?
+                        <Button type="primary" onClick={() => {
+                            console.log('hello');
+                        }}>save</Button>
+                        :
+                        this.props.trialcase?
+                            ''
+                            :
+                            <Button type="primary" onClick={() => {
+                                console.log('hello');
+                            }}>save</Button>
+                }
+
             </div>
         )
 

+ 11 - 6
src/app/common/deploy/tencent/TencentConfig.js

@@ -8,6 +8,7 @@ import NotificationCard from './NotificationCard';
 import {SHOW_DEPLOY, SHOW_APIGWGROUP, SHOW_APIGWPATH} from "../../../../gql";
 import {request} from 'graphql-request'
 import {graphqlUrl} from "../../../../config";
+import {FormattedMessage} from 'react-intl';
 
 class TencentConfig extends Component {
     constructor(props) {
@@ -25,9 +26,11 @@ class TencentConfig extends Component {
             cloudID: props.cloudID,
             fc: props.fc
         };
-        this.fetch();
     }
 
+    componentDidMount() {
+        this.fetch();
+    }
 
     componentWillReceiveProps(next) {
         this.setState({
@@ -97,13 +100,15 @@ class TencentConfig extends Component {
                 <div style={{padding: '30px'}}>
                     <Row gutter={16}>
                         <Col span={14}>
-                            <Card title="Deploy" style={{marginBottom: 10}}><DeployCard deploy={this.state.currentDeploy} switchRegion={this.switchRegion} region={this.state.region} defalutName={this.props.defalutName} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind}/></Card>
-                            <Card title="API Group" style={{marginBottom: 10}}><APIGroupCard group={this.state.currentGroup} switchRegion={this.switchRegion} region={this.state.region} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind}/></Card>
-                            <Card title="API Path" style={{marginBottom: 10}}><APIPathCard path={this.state.currentPath} defalutName={this.props.defalutName} userID={this.props.userID} deployID={this.state.currentDeploy? this.state.currentDeploy.id : this.state.deployIdPassToPath} groupID={this.state.currentGroup? this.state.currentGroup.id : this.state.groupIdPassToPath}/></Card>
-                            <Card title="Notification"><NotificationCard userID={this.props.userID}/></Card>
+                            <FormattedMessage id="Deploy">{msg => <Card title={msg} style={{marginBottom: 10}}><DeployCard deploy={this.state.currentDeploy} switchRegion={this.switchRegion} region={this.state.region} defalutName={this.props.defalutName} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="API Group">{msg => <Card title={msg} style={{marginBottom: 10}}><APIGroupCard group={this.state.currentGroup} switchRegion={this.switchRegion} region={this.state.region} userID={this.props.userID} cloudID={this.props.cloudID} pass={this.pass} kind={this.props.kind} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="API Path">{msg => <Card title={msg} style={{marginBottom: 10}}><APIPathCard path={this.state.currentPath} defalutName={this.props.defalutName} userID={this.props.userID} deployID={this.state.currentDeploy? this.state.currentDeploy.id : this.state.deployIdPassToPath} groupID={this.state.currentGroup? this.state.currentGroup.id : this.state.groupIdPassToPath} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+                            <FormattedMessage id="Notification">{msg => <Card title={msg}><NotificationCard userID={this.props.userID} trialcase={this.props.trialcase}/></Card>}</FormattedMessage>
+
+
                         </Col>
                         <Col offset={2} span={6}>
-                            <Button type='primary'>deploy it</Button>
+                            <Button type='primary'><FormattedMessage id="deploy"/>!</Button>
                         </Col>
                     </Row>
                 </div>

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

@@ -9,7 +9,7 @@ import Graphql from "./component/graphql/Graphql";
 import CaseMetabase from "./component/caseMetabase/CaseMetabase";
 import axios from 'axios';
 import {getIdUrl} from "../../config";
-
+import {FormattedMessage} from 'react-intl';
 axios.defaults.withCredentials = true;
 
 const {Content} = Layout;
@@ -73,7 +73,7 @@ class UserCreate extends Component {
                                     case 'schema':
                                         return <Schema trialcase={false} userID={this.state.userID} schemaName={schemaName} schemaID={schemaID} history={this.props.history} location={this.props.location}/>;
                                     case 'deploy':
-                                        return <Deploy userID={this.state.userID} schemaID={schemaID}/>;
+                                        return <Deploy trialcase={false} userID={this.state.userID} schemaID={schemaID}/>;
                                     case 'graphiql':
                                         return <Graphql/>;
                                     case 'template':

+ 34 - 28
src/app/graphqlService/component/schema/Schema.jsx

@@ -19,6 +19,7 @@ import {getCookie} from "../../../../cookie";
 import {idGen} from "../../../../func";
 import {graphqlUrl} from "../../../../config";
 import {manageUsers} from "../../../../config";
+import {FormattedMessage} from 'react-intl';
 
 const confirm = Modal.confirm;
 const Search = Input.Search;
@@ -228,9 +229,10 @@ class Schema extends Component {
                                             <div className={'schema-table-list-title'}>
                                                 <Row>
                                                     <Col span={10}><span
-                                                        className={'schema-table-title'}>Name</span></Col>
+                                                        className={'schema-table-title'}><FormattedMessage
+                                                        id="Name"/></span></Col>
                                                     <Col span={10}><span
-                                                        className={'schema-table-title'}>Remark</span></Col>
+                                                        className={'schema-table-title'}><FormattedMessage id="Remark"/></span></Col>
                                                     <Col span={2} offset={2}>
                                                         {
                                                             userID.indexOf(manageUsers) > -1 ?
@@ -541,7 +543,7 @@ class CopySchemaButton extends Component {
                                     });
                                 }}
 
-                            >copy</Button>
+                            ><FormattedMessage id="copy"/></Button>
                         )
                     }}
                 </Mutation>
@@ -603,7 +605,7 @@ class DeleteSchemaButton extends Component {
                                 this.showConfirm(delete_schema, schemaName, userID);
                             }}
                         >
-                            delete
+                            <FormattedMessage id="delete"/>
                         </Button>
                     )
                 }}
@@ -709,30 +711,34 @@ class ModifySchemaNameInput extends Component {
                         return <Spin style={{marginLeft: 3}}/>;
                     return (
                         <div className={'schema'}>
-                            <Search
-                                value={this.props.editSchemaName}
-                                enterButton="Confirm"
-                                style={{width: 500}}
-                                size="large"
-                                onChange={this.props.changeEditSchemaName}
-                                onSearch={value => {
-                                    update_schema({
-                                        variables: {
-                                            id: this.props.schemaID,
-                                            schemaName: value,
-                                            updateAt: new Date().getTime()
-                                        }
-                                    });
-                                    this.props.history.push({
-                                        pathname: `/graphql-service/my-create/${value}`,
-                                        state: {
-                                            schemaName: value,
-                                            schemaID: this.props.schemaID,
-                                        }
-                                    });
-                                    this.props.clearEditSchemaName();
-                                }}
-                            />
+                            <FormattedMessage id="Confirm">
+                                {(msg) => (
+                                    <Search
+                                        value={this.props.editSchemaName}
+                                        enterButton={msg}
+                                        style={{width: 500}}
+                                        size="large"
+                                        onChange={this.props.changeEditSchemaName}
+                                        onSearch={value => {
+                                            update_schema({
+                                                variables: {
+                                                    id: this.props.schemaID,
+                                                    schemaName: value,
+                                                    updateAt: new Date().getTime()
+                                                }
+                                            });
+                                            this.props.history.push({
+                                                pathname: `/graphql-service/my-create/${value}`,
+                                                state: {
+                                                    schemaName: value,
+                                                    schemaID: this.props.schemaID,
+                                                }
+                                            });
+                                            this.props.clearEditSchemaName();
+                                        }}
+                                    />)}
+                            </FormattedMessage>
+
                         </div>
                     )
                 }}

+ 37 - 26
src/app/graphqlService/component/schema/Table.js

@@ -3,6 +3,7 @@ import React, {Component} from 'react';
 import {Layout, Select, Input, Icon, Button, notification, Spin, Modal} from 'antd';
 import {UPDATE_SCHEMA, SHOW_SCHEMA, SHOW_TABLE} from "../../../../gql";
 import gql from "graphql-tag";
+import {FormattedMessage} from 'react-intl';
 
 import {Mutation, Query} from "react-apollo";
 import {getCookie} from "../../../../cookie";
@@ -128,32 +129,38 @@ class Table extends Component {
                 <Layout style={{zIndex: '0'}}>
                     <Content style={{padding: '24px', minHeight: 280, background: '#fff'}}>
                         <div className="column-content">
-                            <span className='table-title'> Table name</span>
-                            <Input
-                                value={this.state.currentTable}
-                                placeholder="please input table name"
-                                style={{width: 200, margin: '10px 0'}}
-                                onChange={(e) => {
-                                    this.setState({currentTable: e.target.value})
-                                }}/>
+                            <span className='table-title'> <FormattedMessage id="Table name"/></span>
+                            <FormattedMessage id="please input table name">
+                                {(msg) => (<Input
+                                    value={this.state.currentTable}
+                                    placeholder={msg}
+                                    style={{width: 200, margin: '10px 0'}}
+                                    onChange={(e) => {
+                                        this.setState({currentTable: e.target.value})
+                                    }}/>)}
+                            </FormattedMessage>
+
                         </div>
 
                         <div style={{marginBottom: 20}}>
-                            <span className='table-title'> Table remark</span>
-                            <Input
-                                value={this.state.remark}
-                                placeholder="please input table remark"
-                                style={{width: 250, margin: '10px 0'}}
-                                onChange={(e) => {
-                                    this.setState({remark: e.target.value})
-                                }}/>
+                            <span className='table-title'> <FormattedMessage id="Table remark"/></span>
+                            <FormattedMessage id="please input table remark">
+                                {(msg) => (<Input
+                                    value={this.state.remark}
+                                    placeholder={msg}
+                                    style={{width: 250, margin: '10px 0'}}
+                                    onChange={(e) => {
+                                        this.setState({remark: e.target.value})
+                                    }}/>)}
+                            </FormattedMessage>
+
                         </div>
 
                         <div>
-                            <span className='table-title'> Table fields</span>
-                            <span className='column-title'>name</span>
-                            <span className='column-title'>type</span>
-                            <span className='column-title'>description</span>
+                            <span className='table-title'> <FormattedMessage id="Table fields"/></span>
+                            <span className='column-title'><FormattedMessage id="name"/></span>
+                            <span className='column-title'><FormattedMessage id="type"/></span>
+                            <span className='column-title'><FormattedMessage id="description"/></span>
                             {
                                 this.state.columns.map((col, index) =>
                                     <div key={index} style={{marginBottom: 3}}>
@@ -199,12 +206,15 @@ class Table extends Component {
                                 )
                             }
                             <div>
-                                <Input
-                                    className="column-details"
-                                    placeholder="field name"
-                                    onChange={this.handleNameNew}
-                                    value={this.state.newColName}
-                                />
+                                <FormattedMessage id="field name">
+                                    {(msg) => (<Input
+                                        className="column-details"
+                                        placeholder={msg}
+                                        onChange={this.handleNameNew}
+                                        value={this.state.newColName}
+                                    />)}
+                                </FormattedMessage>
+
                                 <Select
                                     className="column-details"
                                     defaultValue="type"
@@ -357,6 +367,7 @@ class UpdateTableButton extends Component {
                                     else schemaCols = JSON.parse(schemaData.schema_by_id.schemaData);
 
                                     // 处理一下description的问题
+
                                     let cols = this.props.columns;
                                     cols.map(obj => {
                                         if (obj.description === 'description')

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

@@ -8,7 +8,7 @@ import WxConfig from "./wxConfig/WxConfig";
 import WxDeploy from "../common/deploy/Deploy";
 import WxResult from './wxResult/WxResult';
 import axios from 'axios';
-
+import {FormattedMessage} from 'react-intl';
 axios.defaults.withCredentials = true;
 
 const {Content} = Layout;
@@ -63,9 +63,9 @@ class WxUserCreate extends Component {
                     onClick={(e) => this.switchMenu('menuLevel3', e)}
                     selectedKeys={[this.state.menuLevel3]}
                 >
-                    <Menu.Item key="wechat-config">config settings</Menu.Item>
-                    <Menu.Item key="wechat-deploy">deploy settings</Menu.Item>
-                    <Menu.Item key="wechat-result">result</Menu.Item>
+                    <Menu.Item key="wechat-config"><FormattedMessage id="config"/></Menu.Item>
+                    <Menu.Item key="wechat-deploy"><FormattedMessage id="deploy"/></Menu.Item>
+                    <Menu.Item key="wechat-result"><FormattedMessage id="result"/></Menu.Item>
                 </Menu>
 
                 <Layout style={{padding: '24px', zIndex: '0'}}>
@@ -75,7 +75,7 @@ class WxUserCreate extends Component {
                                 case 'wechat-config':
                                     return <WxConfig history={this.props.history} location={this.props.location}/>;
                                 case 'wechat-deploy':
-                                    return <WxDeploy userID={this.state.userID} configID={configID}/>;
+                                    return <WxDeploy trialcase={false} userID={this.state.userID} configID={configID}/>;
                                 case 'wechat-result':
                                     return <WxResult/>;
                                 default:

+ 2 - 2
src/login/AccountConfig.js

@@ -44,7 +44,7 @@ class AccountConfig extends Component {
                         <Row>
                             <Col span={20} offset={4} className={'message-wrapper'}>
                                 <Row>
-                                    <Col span={22}>
+                                    <Col span={20}>
                                         {
                                             this.state.editNickname ?
                                                 <EditNickname kind={'nickname'} cancelEdit={this.cancelEdit}/>
@@ -74,7 +74,7 @@ class AccountConfig extends Component {
                                                 </div>
                                         }
                                     </Col>
-                                    <Col span={2}>
+                                    <Col span={4}>
                                         <div className="back-to-login" onClick={() => {
                                             this.props.history.push({
                                                 pathname: '/login',

+ 1 - 1
src/login/Login.js

@@ -3,7 +3,7 @@ import LoginInput from './LoginInput';
 import CloudConfig from "./CloudConfig";
 import AccountConfig from "./AccountConfig";
 import classnames from 'classnames';
-
+import {FormattedMessage} from 'react-intl';
 import {Layout} from 'antd';
 import './index.css';
 

+ 1 - 0
src/login/index.css

@@ -113,4 +113,5 @@
   display: inline-block;
   line-height: 36px;
   font-size: 16px;
+  padding-right: 50px;
 }