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
182173d4
Commit
182173d4
authored
Nov 16, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首次登陆修改密码
parent
9f85e411
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
login.ts
src/models/login.ts
+10
-7
login2.tsx
src/pages/user/login/login2.tsx
+1
-1
No files found.
src/models/login.ts
View file @
182173d4
...
@@ -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
);
}
}
},
},
...
...
src/pages/user/login/login2.tsx
View file @
182173d4
...
@@ -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
)
=>
{
...
...
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