Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
581c456b
Commit
581c456b
authored
Jan 25, 2021
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录模块添加弹窗错误提示
parent
b32b2ffc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
+4
-11
login.ts
src/models/login.ts
+1
-3
index.tsx
src/pages/user/login/index.tsx
+3
-6
login.ts
src/services/login.ts
+0
-2
No files found.
src/models/login.ts
View file @
581c456b
...
...
@@ -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
,
...
...
src/pages/user/login/index.tsx
View file @
581c456b
...
...
@@ -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
{
...
...
src/services/login.ts
View file @
581c456b
...
...
@@ -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
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment