|
1 | 1 | import React, { PureComponent } from 'react'; |
2 | 2 | import { connect } from 'dva'; |
3 | 3 | import moment from 'moment'; |
| 4 | +import { Typography, Card, Alert } from 'antd'; |
4 | 5 | import PageHeaderLayout from '../../layouts/PageHeaderLayout'; |
5 | 6 | import styles from './Home.less'; |
6 | 7 |
|
| 8 | +const CodePreview = ({ children }) => ( |
| 9 | + <pre className={styles.pre}> |
| 10 | + <code> |
| 11 | + <Typography.Text copyable>{children}</Typography.Text> |
| 12 | + </code> |
| 13 | + </pre> |
| 14 | +); |
| 15 | + |
7 | 16 | @connect(state => ({ |
8 | 17 | global: state.global, |
9 | 18 | })) |
@@ -58,7 +67,61 @@ class Home extends PureComponent { |
58 | 67 | content={this.getHeaderContent()} |
59 | 68 | action={<span>当前时间:{currentTime}</span>} |
60 | 69 | > |
61 | | - <div className={styles.index} /> |
| 70 | + <Card> |
| 71 | + <Alert |
| 72 | + message="gin-admin 5.2.1 现已发布,欢迎使用 gin-admin-cli 启动体验。" |
| 73 | + type="success" |
| 74 | + showIcon |
| 75 | + banner |
| 76 | + style={{ |
| 77 | + margin: -12, |
| 78 | + marginBottom: 24, |
| 79 | + }} |
| 80 | + /> |
| 81 | + <Typography.Text strong> |
| 82 | + <a |
| 83 | + target="_blank" |
| 84 | + rel="noopener noreferrer" |
| 85 | + href="https://github.com/LyricTian/gin-admin-cli" |
| 86 | + > |
| 87 | + 1. 基于 gin-admin-cli 构建 |
| 88 | + </a> |
| 89 | + </Typography.Text> |
| 90 | + <CodePreview>go get -v github.com/LyricTian/gin-admin-cli</CodePreview> |
| 91 | + <CodePreview>gin-admin-cli new -m -d ~/go/src/gin-admin -p gin-admin</CodePreview> |
| 92 | + <Typography.Text strong> |
| 93 | + <a |
| 94 | + target="_blank" |
| 95 | + rel="noopener noreferrer" |
| 96 | + href="https://github.com/LyricTian/gin-admin" |
| 97 | + > |
| 98 | + 2. 启动服务 |
| 99 | + </a> |
| 100 | + </Typography.Text> |
| 101 | + <CodePreview>cd ~/go/src/gin-admin</CodePreview> |
| 102 | + <CodePreview> |
| 103 | + go run cmd/server/main.go -c ./configs/config.toml -m ./configs/model.conf -swagger |
| 104 | + ./docs/swagger -menu ./configs/menu.json |
| 105 | + </CodePreview> |
| 106 | + <Typography.Text |
| 107 | + strong |
| 108 | + style={{ |
| 109 | + marginBottom: 12, |
| 110 | + }} |
| 111 | + > |
| 112 | + <a |
| 113 | + target="_blank" |
| 114 | + rel="noopener noreferrer" |
| 115 | + href="https://github.com/LyricTian/gin-admin-react" |
| 116 | + > |
| 117 | + 3. 获取并运行 gin-admin-react |
| 118 | + </a> |
| 119 | + </Typography.Text> |
| 120 | + <CodePreview>git clone https://github.com/LyricTian/gin-admin-react.git</CodePreview> |
| 121 | + <CodePreview>cd gin-admin-react</CodePreview> |
| 122 | + <CodePreview>yarn</CodePreview> |
| 123 | + <CodePreview>yarn start</CodePreview> |
| 124 | + </Card> |
62 | 125 | </PageHeaderLayout> |
63 | 126 | ); |
64 | 127 | } |
|
0 commit comments