mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
feat: 登录时记住密码
This commit is contained in:
parent
809f2835a7
commit
b6fe780097
@ -4,20 +4,23 @@ import {
|
||||
LOGIN_TYPE
|
||||
} from '../constants/action-types.js';
|
||||
import axios from 'axios';
|
||||
import Cookies from 'universal-cookie';
|
||||
const cookies = new Cookies();
|
||||
|
||||
const loginActions = (data) => {
|
||||
axios.get('/user/login', data).then((res) => {
|
||||
return (dispatch) => {
|
||||
return (dispatch) => {
|
||||
axios.get('/user/login', data).then((res) => {
|
||||
cookies.set(data.email, data.password);
|
||||
dispatch({
|
||||
type: LOGIN,
|
||||
payload: {
|
||||
data: res
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const regActions = (data) => {
|
||||
|
@ -53,7 +53,6 @@ class Login extends Component {
|
||||
<FormItem>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [{ required: true, message: '请输入email!' }],
|
||||
initialValue: 'test',
|
||||
onChange(e) {
|
||||
that.handleChange(e.target.value);
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ class Login extends Component {
|
||||
<FormItem>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [{ required: true, message: '请输入email!' }],
|
||||
initialValue: 'test',
|
||||
onChange(e) {
|
||||
that.handleChange(e.target.value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user