Commit 182173d4 authored by Sixiang_Zzb's avatar Sixiang_Zzb

首次登陆修改密码

parent 9f85e411
...@@ -55,12 +55,16 @@ const Model: LoginModelType = { ...@@ -55,12 +55,16 @@ const Model: LoginModelType = {
effects: { effects: {
*login({ payload }, { call, put }) { *login({ payload }, { call, put }) {
const response = yield call(AccountLogin, payload); const response = yield call(AccountLogin, payload);
yield put({
type: 'changeLoginStatus', if (response.status === 'resetPwd') {
payload: response, // if () {
}); // }
// Login successfully response.status === 'ok' } else if (response.status === 'ok' && response.token != null) {
if (response.token != null) { yield put({
type: 'changeLoginStatus',
payload: response,
});
// Login successfully response.status === 'ok'
console.log('用户名密码登录成功'); console.log('用户名密码登录成功');
console.log(response); console.log(response);
const userMessage = yield call(AccountCheckLogin, payload); //请求时间网络 const userMessage = yield call(AccountCheckLogin, payload); //请求时间网络
...@@ -95,7 +99,6 @@ const Model: LoginModelType = { ...@@ -95,7 +99,6 @@ const Model: LoginModelType = {
} }
history.replace(redirect || '/'); history.replace(redirect || '/');
} else { } else {
console.error(response);
message.error('Login Error! Username or Password is wrong!', 3); message.error('Login Error! Username or Password is wrong!', 3);
} }
}, },
......
...@@ -6,7 +6,7 @@ interface Password { ...@@ -6,7 +6,7 @@ interface Password {
password: string; password: string;
} }
const Login2 = (props: any) => { const Login2 = (props: { history: { push: (location: string) => void } }) => {
const { history } = props; const { history } = props;
// 修改密码 // 修改密码
const onFinish = (values: Password) => { const onFinish = (values: Password) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment