Commit 581c456b authored by Sixiang_Zzb's avatar Sixiang_Zzb

登录模块添加弹窗错误提示

parent b32b2ffc
...@@ -81,7 +81,6 @@ const Model: LoginModelType = { ...@@ -81,7 +81,6 @@ const Model: LoginModelType = {
effects: { effects: {
*login({ payload }, { call, put }) { *login({ payload }, { call, put }) {
console.log(payload);
const response = yield call(AccountLogin, payload.values); const response = yield call(AccountLogin, payload.values);
if (response.status === 'resetPwd') { if (response.status === 'resetPwd') {
// console.log('跳转到修改密码页面'); // console.log('跳转到修改密码页面');
...@@ -153,8 +152,7 @@ const Model: LoginModelType = { ...@@ -153,8 +152,7 @@ const Model: LoginModelType = {
// 只跳到首页 // 只跳到首页
history.replace('/'); history.replace('/');
} else { } else {
// message.error('Login Error! Username or Password is wrong!', 3); message.error("Wrong account or password!");
yield put({ yield put({
type: "setResultLogin", type: "setResultLogin",
resultLogin: true, resultLogin: true,
......
...@@ -18,8 +18,8 @@ interface LoginProps { ...@@ -18,8 +18,8 @@ interface LoginProps {
} }
const Login: React.FC<LoginProps> = (props) => { const Login: React.FC<LoginProps> = (props) => {
const { userLogin = {}, submitting, dispatch } = props; const { userLogin = {}, dispatch } = props;
const { status, type: loginType, resultLogin } = userLogin; const { resultLogin } = userLogin;
const [userName, setUsername] = useState(''); const [userName, setUsername] = useState('');
const [forgetflag, setForgetFlag] = useState(false); const [forgetflag, setForgetFlag] = useState(false);
...@@ -36,7 +36,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -36,7 +36,6 @@ const Login: React.FC<LoginProps> = (props) => {
if (location.pathname === '/user/login') { if (location.pathname === '/user/login') {
const name = getCookie('remenberUserName'); const name = getCookie('remenberUserName');
const Pwd = getCookie('remenberPwd'); const Pwd = getCookie('remenberPwd');
console.log(name, Pwd);
if (Pwd && name) { if (Pwd && name) {
setRemenber(true); setRemenber(true);
const values = { const values = {
...@@ -63,7 +62,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -63,7 +62,7 @@ const Login: React.FC<LoginProps> = (props) => {
payload: userName, payload: userName,
}); });
} else { } else {
message.error('MemberCode!'); message.error('MemberCode!!!');
dispatch({ dispatch({
type: 'login/setResult', type: 'login/setResult',
payload: { payload: {
...@@ -105,7 +104,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -105,7 +104,6 @@ const Login: React.FC<LoginProps> = (props) => {
userName !== '' && userName !== '' &&
/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName) /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName)
) { ) {
console.log('邮箱正确!');
onGetCaptcha(userName); onGetCaptcha(userName);
} else { } else {
message.warning('Please enter the correct email address!'); message.warning('Please enter the correct email address!');
...@@ -123,7 +121,6 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -123,7 +121,6 @@ const Login: React.FC<LoginProps> = (props) => {
// getCaptcha // getCaptcha
setTiming(true); setTiming(true);
const result = await getCaptcha({ account: email }); const result = await getCaptcha({ account: email });
console.log(result);
if (result.error_code === '0000') { if (result.error_code === '0000') {
message.success('Has Been Sent!'); message.success('Has Been Sent!');
} else { } else {
......
...@@ -21,8 +21,6 @@ export interface PwdType { ...@@ -21,8 +21,6 @@ export interface PwdType {
} }
export async function AccountLogin(params: LoginParamsType) { export async function AccountLogin(params: LoginParamsType) {
console.log('登录请求');
console.log(params);
return request('/tos/user/login', { method: 'POST', data: params }); return request('/tos/user/login', { method: 'POST', data: params });
} }
......
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