Commit 581c456b authored by Sixiang_Zzb's avatar Sixiang_Zzb

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

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