|
|
@@ -1,7 +1,8 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import {Layout, Card, Icon, Button, Avatar} from 'antd';
|
|
|
+import {Layout, Card, notification, Button, Avatar} from 'antd';
|
|
|
import lo from '../../../images/lo.png'
|
|
|
import './index.css'
|
|
|
+import {getCookie} from "../../../cookie";
|
|
|
|
|
|
const {Content} = Layout;
|
|
|
const {Meta} = Card;
|
|
|
@@ -9,17 +10,30 @@ const {Meta} = Card;
|
|
|
class ExampleShow extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.state = {}
|
|
|
+ this.state = {
|
|
|
+ userID: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillMount() {
|
|
|
+ let userID = getCookie('user_id');
|
|
|
+ if (userID !== undefined && userID !== '') {
|
|
|
+ this.setState({
|
|
|
+ userID
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
renderCard = () => {
|
|
|
let examples = [
|
|
|
- {title: '预约', description: '小程序', img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/gh_09a69a242b5a_258.jpg', deployedNum: 100},
|
|
|
- {title: '预约', description: '公众号', img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/qrcode_for_gh_abcdd8e08f94_258.jpg', deployedNum: 90},
|
|
|
- {title: '电商', description: '小程序', img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png', deployedNum: 120},
|
|
|
- {title: '电商', description: '公众号', img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png', deployedNum: 105}
|
|
|
+ {schemaID: '', title: '预约', description: '小程序', img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/gh_09a69a242b5a_258.jpg', deployedNum: 100},
|
|
|
+ {schemaID: '', title: '预约', description: '公众号', img: 'https://order-img-1254337200.cos.ap-shanghai.myqcloud.com/qrcode_for_gh_abcdd8e08f94_258.jpg', deployedNum: 90},
|
|
|
+ {schemaID: '', title: '电商', description: '小程序', img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png', deployedNum: 120},
|
|
|
+ {schemaID: '', title: '电商', description: '公众号', img: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png', deployedNum: 105}
|
|
|
];
|
|
|
|
|
|
+ let {userID} = this.state;
|
|
|
+
|
|
|
return examples.map((item, index) => (
|
|
|
<span key={index} style={{padding: '10px 0'}}>
|
|
|
<Card
|
|
|
@@ -29,7 +43,20 @@ class ExampleShow extends Component {
|
|
|
actions={[
|
|
|
<span>已部署: {item.deployedNum}</span>,
|
|
|
<Button type="primary" onClick={() => {
|
|
|
- console.log('部署')
|
|
|
+ if(userID) {
|
|
|
+ this.props.history.push({
|
|
|
+ pathname: `/common/deploy-cloud-choose`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ notification['warning']({
|
|
|
+ message: '需要登录',
|
|
|
+ description: '后续使用,需要先登录',
|
|
|
+ });
|
|
|
+
|
|
|
+ this.props.history.push({
|
|
|
+ pathname: `/login`
|
|
|
+ })
|
|
|
+ }
|
|
|
}}>部署</Button>
|
|
|
]}
|
|
|
>
|