mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
Merge branch 'dev' of http://gitlab.corp.qunar.com/mfe/yapi into dev
This commit is contained in:
commit
bd70fe6c7a
@ -13,7 +13,7 @@ const { Header } = Layout;
|
||||
const MenuUser = (props) => (
|
||||
<Menu>
|
||||
<Menu.Item key="0">
|
||||
<Link to={`/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 key="1">
|
||||
<Link to="/news" onClick={props.relieveLink}><Icon type="mail" />{ props.msg }</Link>
|
||||
@ -178,4 +178,4 @@ export default connect(
|
||||
checkLoginState,
|
||||
changeMenuItem
|
||||
}
|
||||
)(HeaderCom)
|
||||
)(HeaderCom)
|
||||
|
@ -66,7 +66,11 @@ class Login extends Component {
|
||||
{/* 用户名 (Email) */}
|
||||
<FormItem style={formItemStyle}>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [{ required: true, message: '请输入email!' }]
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入正确的email!',
|
||||
pattern: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
|
||||
}]
|
||||
})(
|
||||
<Input style={changeHeight} prefix={<Icon type="user" style={{ fontSize: 13 }} />} placeholder="Email" />
|
||||
)}
|
||||
|
@ -94,7 +94,11 @@ class Reg extends Component {
|
||||
{/* Emaiil */}
|
||||
<FormItem style={formItemStyle}>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [{ required: true, message: '请输入email!' }]
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入email!',
|
||||
pattern: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
|
||||
}]
|
||||
})(
|
||||
<Input style={changeHeight} prefix={<Icon type="user" style={{ fontSize: 13 }} />} placeholder="Email" />
|
||||
)}
|
||||
|
@ -29,13 +29,17 @@ export default (state = initialState, action) => {
|
||||
};
|
||||
}
|
||||
case LOGIN: {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
if (action.payload.data.errcode === 0) {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
} else {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
case LOGIN_OUT: {
|
||||
return{
|
||||
|
@ -29,13 +29,17 @@ export default (state = initialState, action) => {
|
||||
};
|
||||
}
|
||||
case LOGIN: {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
if (action.payload.data.errcode === 0) {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
} else {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
case LOGIN_OUT: {
|
||||
return{
|
||||
|
Loading…
Reference in New Issue
Block a user