mirror of
https://github.com/YMFE/yapi.git
synced 2025-03-07 14:16:52 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
469c3d480c
@ -53,6 +53,7 @@ export default class App extends Component {
|
|||||||
} else {
|
} else {
|
||||||
r = (
|
r = (
|
||||||
<Router >
|
<Router >
|
||||||
|
<div className="g-main">
|
||||||
<div className="router-main">
|
<div className="router-main">
|
||||||
{this.props.loginState !== 1 ? <Header /> : null}
|
{this.props.loginState !== 1 ? <Header /> : null}
|
||||||
<div className="router-container">
|
<div className="router-container">
|
||||||
@ -68,6 +69,7 @@ export default class App extends Component {
|
|||||||
// <Route path="/add-interface" component={requireAuthentication(AddInterface)} />
|
// <Route path="/add-interface" component={requireAuthentication(AddInterface)} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
</Router>
|
</Router>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import './Footer.scss'
|
import './Footer.scss'
|
||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import { Row, Col } from 'antd';
|
||||||
import { Icon } from 'antd'
|
import { Icon } from 'antd'
|
||||||
class Footer extends Component {
|
class Footer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -10,23 +11,17 @@ class Footer extends Component {
|
|||||||
footList: PropTypes.array
|
footList: PropTypes.array
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const style = {
|
|
||||||
'background': 'url(/image/footer-bac.jpg)'
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className = 'footer-wrapper'>
|
<div className="footer-wrapper">
|
||||||
<div className = 'footer' style = {style}>
|
<Row>
|
||||||
<div className = 'footContent'>
|
|
||||||
{ this.props.footList.map(function(item,i){
|
{ this.props.footList.map(function(item,i){
|
||||||
return <FootItem key={ i } linkList={ item.linkList } title={ item.title } iconType={ item.iconType } ></FootItem>
|
return <FootItem key={ i } linkList={ item.linkList } title={ item.title } iconType={ item.iconType } ></FootItem>
|
||||||
}) }
|
}) }
|
||||||
<div className = 'copyRight'>
|
<div className="copyRight">
|
||||||
<h4>Copyright © 2017</h4>
|
<h4>Copyright © 2017</h4>
|
||||||
YMFF出品 @ YMFF
|
YMFF出品 @ YMFF
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Row>
|
||||||
<div className='footerMask'></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -43,12 +38,12 @@ class FootItem extends Component {
|
|||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div className = 'footItem'>
|
<Col span={6}>
|
||||||
<h4><Icon type={ this.props.iconType } style={{ fontSize: 16 }} /> { this.props.title } </h4>
|
<h4><Icon type={ this.props.iconType } style={{ fontSize: 16 }} /> { this.props.title } </h4>
|
||||||
{ this.props.linkList.map(function(item,i){
|
{ this.props.linkList.map(function(item,i){
|
||||||
return (<div key={i}> <a href={ item.itemLink }><span>{ item.itemTitle }</span></a></div>);
|
return (<div key={i}> <a href={ item.itemLink }><span>{ item.itemTitle }</span></a></div>);
|
||||||
}) }
|
}) }
|
||||||
</div>
|
</Col>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,39 +2,10 @@
|
|||||||
@import '../../styles/mixin.scss';
|
@import '../../styles/mixin.scss';
|
||||||
|
|
||||||
.footer-wrapper{
|
.footer-wrapper{
|
||||||
|
height: 2rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.footer{
|
|
||||||
@include wrap-width-limit;
|
|
||||||
margin: 0 auto;
|
|
||||||
clear: both;
|
|
||||||
font-size: 12px;
|
|
||||||
background: #000c15;
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
color: rgba(255,255,255,.65);
|
|
||||||
box-shadow: 0 1000px 0 1000px #fff;
|
|
||||||
// background-image: url('image/footer-bac.jpg');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: center center;
|
|
||||||
h4{
|
|
||||||
margin-bottom: 20px;
|
|
||||||
color: #FFF;
|
|
||||||
i{
|
|
||||||
margin-left: -20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.footerMask{
|
|
||||||
@include wrap-width-limit;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #404040;
|
|
||||||
opacity: .65;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
.footContent{
|
.footContent{
|
||||||
@include row-width-limit;
|
@include row-width-limit;
|
||||||
//width:90%;
|
//width:90%;
|
||||||
|
@ -107,18 +107,38 @@ const HomeGuest = () => (
|
|||||||
<Row className="row-card">
|
<Row className="row-card">
|
||||||
<Col span={12} className="section-card">
|
<Col span={12} className="section-card">
|
||||||
<Card title="Mock 规则">
|
<Card title="Mock 规则">
|
||||||
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
<p className="mock-desc">通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
||||||
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
<div className="code">
|
||||||
<p>通过学习一些简单的 Mock 模板规则即可轻松编写接口,这将大大提高定义接口的效率,并且无需为编写 Mock 数据烦恼: 所有的数据都可以实时随机生成。</p>
|
<ol start="1">
|
||||||
|
<li className="alt"><span className="orderNum orderNum-first">1</span><span><span>{  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">2</span><span>    <span className="string">"errcode|200-500"</span><span>: 200,  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">3</span><span>    <span className="string">"errmsg|4-8"</span><span>: </span><span className="string">"@string"</span><span>,  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">4</span><span>    <span className="string">"data"</span><span>: {  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">5</span><span>        <span className="string">"boolean|1"</span><span>: </span><span className="keyword">true</span><span>,  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">6</span><span>        <span className="string">"array|4"</span><span>: 1,  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">7</span><span>        <span className="string">"combine"</span><span>: </span><span className="string">"@boolean & @array"</span><span>  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">8</span><span>    }  </span></li>
|
||||||
|
<li className="alt"><span className="orderNum orderNum-last">9</span><span>}  </span></li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12} className="section-card mock-after">
|
<Col span={12} className="section-card mock-after">
|
||||||
<Card title="生成的 Mock 数据">
|
<Card title="生成的 Mock 数据">
|
||||||
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
<p className="mock-desc">生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
||||||
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
<div className="code">
|
||||||
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
<ol start="1">
|
||||||
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
<li className="alt"><span className="orderNum orderNum-first">1</span><span><span>{  </span></span></li>
|
||||||
<p>生成的 Mock 数据可以在线使用(配置Hosts后直接访问接口),也可以下载到本地使用。</p>
|
<li className=""><span className="orderNum">2</span><span>  <span className="string">"errcode"</span><span>: </span><span className="number">304</span><span>,  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">3</span><span>  <span className="string">"errmsg"</span><span>: </span><span className="string">"JtkMIoRu)N#ie^h%Z77[F)"</span><span>,  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">4</span><span>  <span className="string">"data"</span><span>: {  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">5</span><span>    <span className="string">"boolean"</span><span>: </span><span className="keyword">true</span><span>,  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">6</span><span>    <span className="string">"array"</span><span>: </span><span className="number">4</span><span>,  </span></span></li>
|
||||||
|
<li className="alt"><span className="orderNum">7</span><span>    <span className="string">"combine"</span><span>: </span><span className="string">"true & 4"</span><span>  </span></span></li>
|
||||||
|
<li className=""><span className="orderNum">8</span><span>  }  </span></li>
|
||||||
|
<li className="alt"><span className="orderNum orderNum-last">9</span><span>}  </span></li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
@ -206,8 +226,6 @@ class Home extends Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
: <HomeGuest introList={this.props.introList}/>}
|
: <HomeGuest introList={this.props.introList}/>}
|
||||||
<div style={{height: '1000px'}}>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ $color-blue-light: #5dade2;
|
|||||||
$color-black-lighter: #404040;
|
$color-black-lighter: #404040;
|
||||||
$color-text-dark: #2e2e5a;
|
$color-text-dark: #2e2e5a;
|
||||||
$color-text-light: #6d7c90;
|
$color-text-light: #6d7c90;
|
||||||
|
$color-bg-lightblue: #c6e2ff;
|
||||||
.g-body {
|
.g-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -360,13 +361,37 @@ $color-text-light: #6d7c90;
|
|||||||
}
|
}
|
||||||
.ant-card-body {
|
.ant-card-body {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.mock-desc {
|
||||||
padding: .32rem;
|
padding: .32rem;
|
||||||
|
min-height: 8em;
|
||||||
}
|
}
|
||||||
padding: .08rem;
|
padding: .08rem;
|
||||||
}
|
}
|
||||||
|
.code {
|
||||||
|
color: $color-text-dark;
|
||||||
|
background-color: $color-blue-grey-lighter;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
.orderNum {
|
||||||
|
background-color: $color-bg-lightblue;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
width: .4rem;
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
||||||
|
.orderNum-first {
|
||||||
|
padding-top: .5em;
|
||||||
|
}
|
||||||
|
.orderNum-last {
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
padding-bottom: .5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
.mock-after {
|
.mock-after {
|
||||||
.ant-card-head {
|
.ant-card-head {
|
||||||
background-color: #c6e2ff;
|
background-color: $color-bg-lightblue;
|
||||||
}
|
}
|
||||||
.ant-card-head-title {
|
.ant-card-head-title {
|
||||||
color: #4074af;
|
color: #4074af;
|
||||||
|
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Form, Button, Input, Icon, message } from 'antd';
|
import { Form, Button, Input, Icon, message } from 'antd';
|
||||||
import { loginActions } from '../../reducer/modules/user';
|
import { loginActions } from '../../reducer/modules/user';
|
||||||
|
import { withRouter } from 'react-router'
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
import './Login.scss'
|
import './Login.scss'
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ const changeHeight = {
|
|||||||
loginActions
|
loginActions
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@withRouter
|
||||||
class Login extends Component {
|
class Login extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
@ -32,6 +33,7 @@ class Login extends Component {
|
|||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
form: PropTypes.object,
|
form: PropTypes.object,
|
||||||
|
history: PropTypes.object,
|
||||||
loginActions: PropTypes.func
|
loginActions: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +44,7 @@ class Login extends Component {
|
|||||||
if (!err) {
|
if (!err) {
|
||||||
this.props.loginActions(values).then((res) => {
|
this.props.loginActions(values).then((res) => {
|
||||||
if (res.payload.data.errcode == 0) {
|
if (res.payload.data.errcode == 0) {
|
||||||
|
this.props.history.push('/');
|
||||||
message.success('登录成功! ');
|
message.success('登录成功! ');
|
||||||
} else {
|
} else {
|
||||||
message.error(res.payload.data.errmsg);
|
message.error(res.payload.data.errmsg);
|
||||||
|
@ -39,13 +39,20 @@ em {
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-reactroot], .g-main, .router-main {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
// 页面最外层元素 样式
|
// 页面最外层元素 样式
|
||||||
.router-main {
|
.router-main {
|
||||||
display: -webkit-box;
|
padding-bottom: .24rem;
|
||||||
-webkit-box-orient: vertical;
|
min-height: 100%;
|
||||||
|
height: auto !important;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.router-container{
|
margin-bottom: -2rem;
|
||||||
min-height:calc(100% - 2.47rem);
|
&::after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
height: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user