mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
7138bcd9cb
@ -1,10 +1,11 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Route, HashRouter } from 'react-router-dom'
|
import { Route, HashRouter, Redirect, Switch } from 'react-router-dom'
|
||||||
import { Home, ProjectGroups, Interface, News, AddInterface } from './containers/index'
|
import { Home, ProjectGroups, Interface, News, AddInterface } from './containers/index'
|
||||||
import User from './containers/User/User.js'
|
import User from './containers/User/User.js'
|
||||||
import Header from './components/Header/Header'
|
import Header from './components/Header/Header'
|
||||||
|
import Footer from './components/Footer/Footer'
|
||||||
import Loading from './components/Loading/Loading'
|
import Loading from './components/Loading/Loading'
|
||||||
import { checkLoginState } from './actions/login'
|
import { checkLoginState } from './actions/login'
|
||||||
import { requireAuthentication } from './components/AuthenticatedComponent';
|
import { requireAuthentication } from './components/AuthenticatedComponent';
|
||||||
@ -46,13 +47,16 @@ export default class App extends Component {
|
|||||||
<div className="router-main">
|
<div className="router-main">
|
||||||
<Header />
|
<Header />
|
||||||
<Route path="/" component={Home} exact />
|
<Route path="/" component={Home} exact />
|
||||||
<Route path="/group" component={ requireAuthentication(ProjectGroups) } >
|
{/*<Route exact path="/group" component={ requireAuthentication(ProjectGroups) } ></Route>*/}
|
||||||
<Route exact path="/group/:groupName" component={ ProjectGroups } />
|
<Switch>
|
||||||
</Route>
|
<Redirect exact from='/group' to='/group/1' />
|
||||||
|
<Route exact path="/group/:groupName" component={ requireAuthentication(ProjectGroups) } />
|
||||||
|
</Switch>
|
||||||
<Route path="/Interface" component={requireAuthentication(Interface)} />
|
<Route path="/Interface" component={requireAuthentication(Interface)} />
|
||||||
<Route path="/user" component={requireAuthentication(User)} />
|
<Route path="/user" component={requireAuthentication(User)} />
|
||||||
<Route path="/News" component={requireAuthentication(News)} />
|
<Route path="/News" component={requireAuthentication(News)} />
|
||||||
<Route path="/AddInterface" component={ requireAuthentication(AddInterface) } />
|
<Route path="/AddInterface" component={ requireAuthentication(AddInterface) } />
|
||||||
|
<Footer/>
|
||||||
</div>
|
</div>
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
)
|
)
|
||||||
|
@ -16,9 +16,6 @@ const MenuUser = (props) => (
|
|||||||
<Link to={`/user/profile/${props.uid}`} onClick={props.relieveLink}><Icon type="user" />{ props.user }</Link>
|
<Link to={`/user/profile/${props.uid}`} onClick={props.relieveLink}><Icon type="user" />{ props.user }</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item key="1">
|
<Menu.Item key="1">
|
||||||
<Link to="/news" onClick={props.relieveLink}><Icon type="mail" />{ props.msg }</Link>
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item key="2">
|
|
||||||
<a onClick={props.logout}>退出</a>
|
<a onClick={props.logout}>退出</a>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
@ -122,7 +119,6 @@ class HeaderCom extends Component {
|
|||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { login, user, msg, uid, curKey } = this.props;
|
const { login, user, msg, uid, curKey } = this.props;
|
||||||
console.log(curKey);
|
|
||||||
return (
|
return (
|
||||||
<acticle className="header-box">
|
<acticle className="header-box">
|
||||||
<Layout className="layout">
|
<Layout className="layout">
|
||||||
|
@ -9,7 +9,7 @@ import QueueAnim from 'rc-queue-anim';
|
|||||||
const IntroPart = (props) =>(
|
const IntroPart = (props) =>(
|
||||||
<Col span={12} className="switch-content">
|
<Col span={12} className="switch-content">
|
||||||
<div className="icon-switch">
|
<div className="icon-switch">
|
||||||
<Icon type="smile-o" />
|
<Icon type={props.iconType} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p><b>{props.title}</b></p>
|
<p><b>{props.title}</b></p>
|
||||||
@ -20,7 +20,8 @@ const IntroPart = (props) =>(
|
|||||||
|
|
||||||
IntroPart.propTypes = {
|
IntroPart.propTypes = {
|
||||||
title : PropTypes.string,
|
title : PropTypes.string,
|
||||||
des : PropTypes.string
|
des : PropTypes.string,
|
||||||
|
iconType : PropTypes.string
|
||||||
}
|
}
|
||||||
|
|
||||||
class Intro extends React.Component{
|
class Intro extends React.Component{
|
||||||
@ -81,7 +82,7 @@ class Intro extends React.Component{
|
|||||||
</div>
|
</div>
|
||||||
<div className="des-switch" key={`${id}-des-switch`}>
|
<div className="des-switch" key={`${id}-des-switch`}>
|
||||||
{intro.detail.map(function(item,i){
|
{intro.detail.map(function(item,i){
|
||||||
return(<IntroPart key={i} title={item.title} des={item.des}/>)
|
return(<IntroPart key={i} title={item.title} des={item.des} iconType={item.iconType}/>)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</QueueAnim>
|
</QueueAnim>
|
||||||
|
@ -9,10 +9,10 @@ import Intro from '../../components/Intro/Intro'
|
|||||||
import { changeMenuItem } from '../../actions/menu'
|
import { changeMenuItem } from '../../actions/menu'
|
||||||
import { OverPack } from 'rc-scroll-anim'
|
import { OverPack } from 'rc-scroll-anim'
|
||||||
import TweenOne from 'rc-tween-one'
|
import TweenOne from 'rc-tween-one'
|
||||||
|
import QueueAnim from 'rc-queue-anim';
|
||||||
|
|
||||||
|
|
||||||
const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };
|
const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };
|
||||||
const queueAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad','delay':200 };
|
|
||||||
const HomeGuest = (props) => (
|
const HomeGuest = (props) => (
|
||||||
<div>
|
<div>
|
||||||
<div className="main-one">
|
<div className="main-one">
|
||||||
@ -43,18 +43,22 @@ const HomeGuest = (props) => (
|
|||||||
playScale="0.3"
|
playScale="0.3"
|
||||||
>
|
>
|
||||||
<TweenOne
|
<TweenOne
|
||||||
key="h3"
|
key="feat-motion-one"
|
||||||
animation={oneAnim}
|
animation={oneAnim}
|
||||||
component="h3"
|
component="h3"
|
||||||
>
|
>
|
||||||
<span>特性</span>
|
<span>特性</span>
|
||||||
</TweenOne>
|
</TweenOne>
|
||||||
<TweenOne
|
<Row key="feat-motion-row">
|
||||||
animation={queueAnim}
|
<QueueAnim
|
||||||
reverseDelay={200}
|
delay = {200}
|
||||||
|
interval ={100}
|
||||||
|
type = "bottom"
|
||||||
|
ease = 'easeOutQuad'
|
||||||
|
animConfig ={{ opacity:[1,0],y: '+=30' }}
|
||||||
|
key="feat-motion-queue"
|
||||||
>
|
>
|
||||||
<Row>
|
<Col span={8} className="feat-wrapper" key="feat-wrapper-1">
|
||||||
<Col span={8} className="feat-wrapper">
|
|
||||||
<div className="feat-img">
|
<div className="feat-img">
|
||||||
<Icon type="api" />
|
<Icon type="api" />
|
||||||
</div>
|
</div>
|
||||||
@ -62,7 +66,7 @@ const HomeGuest = (props) => (
|
|||||||
接口管理
|
接口管理
|
||||||
</p>
|
</p>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8} className="feat-wrapper">
|
<Col span={8} className="feat-wrapper" key="feat-wrapper-2">
|
||||||
<div className="feat-img">
|
<div className="feat-img">
|
||||||
<Icon type="link" />
|
<Icon type="link" />
|
||||||
</div>
|
</div>
|
||||||
@ -70,7 +74,7 @@ const HomeGuest = (props) => (
|
|||||||
支持Mock
|
支持Mock
|
||||||
</p>
|
</p>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8} className="feat-wrapper">
|
<Col span={8} className="feat-wrapper" key="feat-wrapper-3">
|
||||||
<div className="feat-img">
|
<div className="feat-img">
|
||||||
<Icon type="team" />
|
<Icon type="team" />
|
||||||
</div>
|
</div>
|
||||||
@ -78,8 +82,8 @@ const HomeGuest = (props) => (
|
|||||||
团队协作
|
团队协作
|
||||||
</p>
|
</p>
|
||||||
</Col>
|
</Col>
|
||||||
|
</QueueAnim>
|
||||||
</Row>
|
</Row>
|
||||||
</TweenOne>
|
|
||||||
</OverPack>
|
</OverPack>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -117,7 +121,7 @@ class Home extends Component {
|
|||||||
changeMenuItem : PropTypes.func
|
changeMenuItem : PropTypes.func
|
||||||
}
|
}
|
||||||
toStart = () =>{
|
toStart = () =>{
|
||||||
this.props.changeMenuItem('/ProjectGroups');
|
this.props.changeMenuItem('/group');
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { login } = this.props;
|
const { login } = this.props;
|
||||||
@ -131,7 +135,7 @@ class Home extends Component {
|
|||||||
<p className="des">一个高效,易用,功能强大的api管理系统</p>
|
<p className="des">一个高效,易用,功能强大的api管理系统</p>
|
||||||
<div className="btn">
|
<div className="btn">
|
||||||
<Button type="primary" size="large">
|
<Button type="primary" size="large">
|
||||||
<Link to="/ProjectGroups" onClick={this.toStart}>开始</Link>
|
<Link to="/group" onClick={this.toStart}>开始</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -148,17 +152,17 @@ Home.defaultProps={
|
|||||||
title:"接口管理",
|
title:"接口管理",
|
||||||
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
||||||
detail:[
|
detail:[
|
||||||
{title:"接口管理",des:"强大的接口文档"},
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
||||||
{title:"接口管理",des:"强大的接口文档"},
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
||||||
{title:"接口管理",des:"强大的接口文档"}
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"}
|
||||||
],
|
],
|
||||||
img:"./image/demo-img.png"
|
img:"./image/demo-img.png"
|
||||||
},{
|
},{
|
||||||
title:"接口管理",
|
title:"接口管理",
|
||||||
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
des:"yapi将满足你的所有接口管理需求。不再需要 为每个项目搭建独立的接口管理平台和编写离线的接口文档",
|
||||||
detail:[
|
detail:[
|
||||||
{title:"接口管理",des:"强大的接口文档"},
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"},
|
||||||
{title:"接口管理",des:"强大的接口文档"}
|
{title:"接口管理",des:"强大的接口文档",iconType:"smile-o"}
|
||||||
],
|
],
|
||||||
img:"./image/demo-img.png"
|
img:"./image/demo-img.png"
|
||||||
}
|
}
|
||||||
|
@ -9,16 +9,14 @@ $color-black-lighter: #404040;
|
|||||||
|
|
||||||
|
|
||||||
.home-main {
|
.home-main {
|
||||||
min-height:calc(100% - 2.23rem);
|
min-height:calc(100% - 2.47rem);
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
background: $color-blue-grey-lighter;
|
background: $color-blue-grey-lighter;
|
||||||
.main-one{
|
.main-one{
|
||||||
padding: .5rem .5rem 0 .5rem;
|
padding: .5rem .5rem 0 .5rem;
|
||||||
//height: 7.16rem;
|
|
||||||
//background: radial-gradient(ellipse at center,#45484d 0%,#000 100%);
|
//background: radial-gradient(ellipse at center,#45484d 0%,#000 100%);
|
||||||
.home-des{
|
.home-des{
|
||||||
padding: 0 .3rem .3rem 0;
|
|
||||||
.title{
|
.title{
|
||||||
font-size: .6rem;
|
font-size: .6rem;
|
||||||
}
|
}
|
||||||
@ -39,6 +37,7 @@ $color-black-lighter: #404040;
|
|||||||
}
|
}
|
||||||
.main-one-left{
|
.main-one-left{
|
||||||
padding-right: .15rem;
|
padding-right: .15rem;
|
||||||
|
margin-top: .2rem;
|
||||||
}
|
}
|
||||||
.main-one-right{
|
.main-one-right{
|
||||||
padding-left: .15rem;
|
padding-left: .15rem;
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
} from '../../constants/action-types.js'
|
} from '../../constants/action-types.js'
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
curKey: window.location.hash.split("#")[1] || ''
|
curKey: '/'+window.location.hash.split("/")[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (state = initialState, action) => {
|
export default (state = initialState, action) => {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
font-size:625%;
|
font-size:625%;
|
||||||
background: #f1f3f6;
|
|
||||||
}
|
}
|
||||||
html, body {
|
html, body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||||
@ -12,6 +11,7 @@ html, body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
background: #f1f3f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
div, article, p, table, tr, td, th, ul, ol, li, h1, h2, h3, form, dl, dt, dd {
|
div, article, p, table, tr, td, th, ul, ol, li, h1, h2, h3, form, dl, dt, dd {
|
||||||
@ -44,5 +44,4 @@ em {
|
|||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #ececec;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user