2017-08-20 18:56:31 +08:00
|
|
|
|
import './Home.scss';
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
import { Row, Col, Button, Icon, Card } from 'antd';
|
|
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
import { logoSVG } from '../../common.js';
|
2017-08-20 17:22:04 +08:00
|
|
|
|
|
|
|
|
|
// import Intro from '../../components/Intro/Intro'
|
2017-08-08 10:07:55 +08:00
|
|
|
|
import { changeMenuItem } from '../../reducer/modules/menu'
|
2017-07-25 15:35:23 +08:00
|
|
|
|
import { OverPack } from 'rc-scroll-anim'
|
|
|
|
|
import TweenOne from 'rc-tween-one'
|
2017-07-25 17:56:04 +08:00
|
|
|
|
import QueueAnim from 'rc-queue-anim';
|
2017-07-14 19:20:52 +08:00
|
|
|
|
|
2017-07-25 15:35:23 +08:00
|
|
|
|
const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };
|
2017-08-20 18:56:31 +08:00
|
|
|
|
|
2017-08-20 17:22:04 +08:00
|
|
|
|
const HomeGuest = () => (
|
|
|
|
|
<div className="g-body">
|
|
|
|
|
<div className="m-bg">
|
|
|
|
|
<div className="m-bg-mask m-bg-mask0"></div>
|
|
|
|
|
<div className="m-bg-mask m-bg-mask1"></div>
|
|
|
|
|
<div className="m-bg-mask m-bg-mask2"></div>
|
|
|
|
|
<div className="m-bg-mask m-bg-mask3"></div>
|
|
|
|
|
</div>
|
2017-08-20 18:56:31 +08:00
|
|
|
|
<div className="main-one">
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<div className="container">
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<div className="home-heander">
|
2017-08-20 18:56:31 +08:00
|
|
|
|
<a href="#" className="item">YAPI</a>
|
|
|
|
|
<a target="_blank" href="/doc/index.html" className="item">使用文档</a>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={9}>
|
|
|
|
|
<div className="home-des">
|
|
|
|
|
<div className="logo">
|
2017-08-20 18:56:31 +08:00
|
|
|
|
{logoSVG('72px')}
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<span className="name">YAPI</span>
|
2017-07-26 16:06:54 +08:00
|
|
|
|
</div>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<div className="detail">高效、易用、可部署的API管理平台<br/><span className="desc">旨在为开发、产品、测试人员提供更优雅的接口管理服务</span></div>
|
|
|
|
|
<div className="btn-group">
|
2017-08-20 18:56:31 +08:00
|
|
|
|
<Link to="/login"><Button type="primary" className="btn-home btn-login">登录 / 注册</Button></Link>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<Button className="btn-home btn-qsso" id="qsso-login">QSSO 登录</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={15}>
|
|
|
|
|
<div className="img-container">
|
|
|
|
|
<img className="img" src="./image/demo-img.jpg"/>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
2017-07-19 14:08:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<div className="feat-part section-feature">
|
|
|
|
|
<div className="container home-section">
|
2017-07-25 15:35:23 +08:00
|
|
|
|
<OverPack
|
2017-07-26 16:06:54 +08:00
|
|
|
|
playScale={[0.2,0.1]}
|
2017-07-25 15:35:23 +08:00
|
|
|
|
>
|
|
|
|
|
<TweenOne
|
2017-07-25 17:56:04 +08:00
|
|
|
|
key="feat-motion-one"
|
2017-07-25 15:35:23 +08:00
|
|
|
|
animation={oneAnim}
|
|
|
|
|
>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<h3 className="title">为API开发者设计的管理平台</h3>
|
|
|
|
|
<span className="desc">YApi让接口开发更简单高效,让接口的管理更具可读性、可维护性,让团队协作更合理。</span>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
</TweenOne>
|
2017-07-25 17:56:04 +08:00
|
|
|
|
<Row key="feat-motion-row">
|
|
|
|
|
<QueueAnim
|
|
|
|
|
delay = {200}
|
2017-07-25 21:04:11 +08:00
|
|
|
|
interval ={200}
|
|
|
|
|
leaveReverse={true}
|
2017-07-25 17:56:04 +08:00
|
|
|
|
ease = 'easeOutQuad'
|
|
|
|
|
animConfig ={{ opacity:[1,0],y: '+=30' }}
|
|
|
|
|
key="feat-motion-queue"
|
|
|
|
|
>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<Col span={8} className="section-item" key="feat-wrapper-1">
|
|
|
|
|
<Icon type="api" className="img" />
|
|
|
|
|
<h4 className="title">项目接口管理</h4>
|
|
|
|
|
<span className="desc">提供基本的项目分组,项目管理,接口管理功能</span>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
</Col>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<Col span={8} className="section-item" key="feat-wrapper-2">
|
|
|
|
|
<Icon type="code-o" className="img" />
|
|
|
|
|
<h4 className="title">可部署</h4>
|
|
|
|
|
<span className="desc">用户只需在项目配置线上域名和接口基本路径,通过将线上域名指到我们的YApi平台服务器,就可使用mockServer服务</span>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
</Col>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<Col span={8} className="section-item" key="feat-wrapper-3">
|
|
|
|
|
<Icon type="team" className="img" />
|
|
|
|
|
<h4 className="title">用户管理</h4>
|
|
|
|
|
<span className="desc">提供基本的用户注册登录管理等功能,集成了去哪儿QSSO登录</span>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
</Col>
|
2017-07-25 17:56:04 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
</Row>
|
2017-07-25 15:35:23 +08:00
|
|
|
|
</OverPack>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-08-20 17:22:04 +08:00
|
|
|
|
<div className="feat-part m-mock m-skew home-section">
|
|
|
|
|
<div className="m-skew-bg">
|
|
|
|
|
<div className="m-bg-mask m-bg-mask0"></div>
|
|
|
|
|
<div className="m-bg-mask m-bg-mask1"></div>
|
|
|
|
|
<div className="m-bg-mask m-bg-mask2"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="container skew-container">
|
|
|
|
|
<h3 className="title">功能强大的 Mock 服务</h3>
|
|
|
|
|
<span className="desc">你想要的 Mock 服务都在这里</span>
|
|
|
|
|
<Row className="row-card">
|
|
|
|
|
<Col span={12} className="section-card">
|
|
|
|
|
<Card title="Mock 规则">
|
|
|
|
|
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
|
|
|
|
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
|
|
|
|
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={12} className="section-card mock-after">
|
|
|
|
|
<Card title="生成的 Mock 数据">
|
|
|
|
|
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
|
|
|
|
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
|
|
|
|
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
|
|
|
|
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
|
|
|
|
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="home-section section-manage">
|
|
|
|
|
<div className="container">
|
|
|
|
|
<Row className="row-card">
|
|
|
|
|
<Col span={7} className="section-card">
|
|
|
|
|
<Card>
|
|
|
|
|
<div className="section-block block-first">
|
|
|
|
|
<h4>超级管理员(* N)</h4>
|
|
|
|
|
<p className="item"> - 创建分组</p>
|
|
|
|
|
<p className="item"> - 分配组长</p>
|
|
|
|
|
<p className="item"> - 管理所有成员信息</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="section-block block-second">
|
|
|
|
|
<h4>组长(* N)</h4>
|
|
|
|
|
<p className="item"> - 创建项目</p>
|
|
|
|
|
<p className="item"> - 管理分组或项目的信息</p>
|
|
|
|
|
<p className="item"> - 管理开发者与成员</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="section-block block-third">
|
|
|
|
|
<h4>开发者(* N) / 成员(* N)</h4>
|
|
|
|
|
<p className="item"> - 不允许创建分组或项目</p>
|
|
|
|
|
<p className="item"> - 不允许修改分组或项目信息</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={17} className="section-card manage-word">
|
|
|
|
|
<Icon type="team" className="icon" />
|
|
|
|
|
<h3 className="title">扁平化管理模式</h3>
|
|
|
|
|
<p className="desc">接口管理的逻辑较为复杂,操作频率高,层层审批将严重拖慢生产效率,因此传统的金字塔管理模式并不适用。</p>
|
|
|
|
|
<p className="desc">YAPI 将扁平化管理模式的思想引入到产品的权限管理中,超级管理员拥有最高的权限,并将权限分配给若干组长,超级管理员只需管理组长即可,实际上管理YAPI各大分组与项目的是“组长”。组长对分组或项目负责,一般由BU负责人/项目负责人担任。</p>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-07-19 14:08:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
HomeGuest.propTypes ={
|
|
|
|
|
introList: PropTypes.array
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@connect(
|
|
|
|
|
state => ({
|
2017-08-10 21:20:57 +08:00
|
|
|
|
login: state.user.isLogin
|
2017-07-20 21:30:35 +08:00
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
changeMenuItem
|
|
|
|
|
}
|
2017-07-19 14:08:24 +08:00
|
|
|
|
)
|
2017-07-05 14:10:06 +08:00
|
|
|
|
|
2017-07-06 17:01:48 +08:00
|
|
|
|
class Home extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
}
|
2017-08-20 17:22:04 +08:00
|
|
|
|
componentDidMount() {
|
|
|
|
|
if(window.QSSO) window.QSSO.attach('qsso-login','/api/user/login_by_token')
|
|
|
|
|
}
|
2017-07-17 21:11:58 +08:00
|
|
|
|
static propTypes = {
|
2017-07-19 14:08:24 +08:00
|
|
|
|
introList: PropTypes.array,
|
2017-07-20 21:30:35 +08:00
|
|
|
|
login : PropTypes.bool,
|
|
|
|
|
changeMenuItem : PropTypes.func
|
|
|
|
|
}
|
|
|
|
|
toStart = () =>{
|
2017-07-25 17:56:04 +08:00
|
|
|
|
this.props.changeMenuItem('/group');
|
2017-07-17 21:11:58 +08:00
|
|
|
|
}
|
2017-07-06 17:01:48 +08:00
|
|
|
|
render () {
|
2017-07-19 14:08:24 +08:00
|
|
|
|
const { login } = this.props;
|
2017-07-06 17:01:48 +08:00
|
|
|
|
return (
|
2017-07-14 19:20:52 +08:00
|
|
|
|
<div className="home-main">
|
2017-07-19 14:08:24 +08:00
|
|
|
|
{login?
|
|
|
|
|
(
|
2017-07-19 17:53:39 +08:00
|
|
|
|
<div className="user-home">
|
|
|
|
|
<div className="user-des">
|
|
|
|
|
<p className="title">YAPI</p>
|
2017-07-25 21:04:11 +08:00
|
|
|
|
<p className="des">一个高效,易用,可部署的Api管理系统</p>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
<div className="btn">
|
|
|
|
|
<Button type="primary" size="large">
|
2017-07-25 17:56:04 +08:00
|
|
|
|
<Link to="/group" onClick={this.toStart}>开始</Link>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2017-07-17 21:11:58 +08:00
|
|
|
|
</div>
|
2017-07-19 17:53:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
)
|
2017-07-19 14:08:24 +08:00
|
|
|
|
: <HomeGuest introList={this.props.introList}/>}
|
2017-07-14 19:20:52 +08:00
|
|
|
|
</div>
|
2017-07-06 17:01:48 +08:00
|
|
|
|
)
|
|
|
|
|
}
|
2017-07-05 21:08:51 +08:00
|
|
|
|
}
|
2017-07-06 17:01:48 +08:00
|
|
|
|
|
2017-08-20 17:22:04 +08:00
|
|
|
|
// Home.defaultProps={
|
|
|
|
|
// introList:[{
|
|
|
|
|
// title:"接口管理",
|
|
|
|
|
// des:"满足你的所有接口管理需求。不再需要为每个项目搭建独立的接口管理平台和编写离线的接口文档,其权限管理和项目日志让协作开发不再痛苦。",
|
|
|
|
|
// detail:[
|
|
|
|
|
// {title:"团队协作",des:"多成员协作,掌握项目进度",iconType:"team"},
|
|
|
|
|
// {title:"权限管理",des:"设置每个成员的操作权限",iconType:"usergroup-add"},
|
|
|
|
|
// {title:"项目日志",des:"推送项目情况,掌握更新动态",iconType:"schedule"}
|
|
|
|
|
// ],
|
|
|
|
|
// img:"./image/demo-img.jpg"
|
|
|
|
|
// },{
|
|
|
|
|
// title:"接口测试",
|
|
|
|
|
// des:"一键即可得到返回结果。根据用户的输入接口信息如协议、URL、接口名、请求头、请求参数、mock规则生成Mock接口,这些接口会自动生成模拟数据。",
|
|
|
|
|
// detail:[
|
|
|
|
|
// {title:"编辑接口",des:"团队开发时任何人都可以在权限许可下创建、修改接口",iconType:"tags-o"},
|
|
|
|
|
// {title:"mock请求",des:"创建者可以自由构造需要的数据,支持复杂的生成逻辑",iconType:"fork"}
|
|
|
|
|
// ],
|
|
|
|
|
// img:"./image/demo-img.jpg"
|
|
|
|
|
// }
|
|
|
|
|
// ]
|
|
|
|
|
// };
|
2017-07-17 21:11:58 +08:00
|
|
|
|
|
2017-07-10 21:29:03 +08:00
|
|
|
|
export default Home
|