Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
6ecfedde
Commit
6ecfedde
authored
Sep 06, 2017
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix login page
parent
246fd23c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
.roadhogrc.mock.js
.roadhogrc.mock.js
+2
-1
src/models/login.js
src/models/login.js
+1
-1
src/routes/User/Login.js
src/routes/User/Login.js
+22
-5
No files found.
.roadhogrc.mock.js
View file @
6ecfedde
...
...
@@ -65,7 +65,8 @@ const proxy = {
'
GET /api/fake_chart_data
'
:
getFakeChartData
,
'
GET /api/profile
'
:
getProfileData
,
'
POST /api/login/account
'
:
(
req
,
res
)
=>
{
res
.
send
({
status
:
'
error
'
,
type
:
'
account
'
});
const
{
password
,
userName
}
=
req
.
body
;
res
.
send
({
status
:
password
===
'
888888
'
&&
userName
===
'
admin
'
?
'
ok
'
:
'
error
'
,
type
:
'
account
'
});
},
'
POST /api/login/mobile
'
:
(
req
,
res
)
=>
{
res
.
send
({
status
:
'
ok
'
,
type
:
'
mobile
'
});
...
...
src/models/login.js
View file @
6ecfedde
...
...
@@ -13,7 +13,7 @@ export default {
type
:
'
changeSubmitting
'
,
payload
:
true
,
});
const
response
=
yield
call
(
fakeAccountLogin
);
const
response
=
yield
call
(
fakeAccountLogin
,
payload
);
yield
put
({
type
:
'
loginHandle
'
,
payload
:
response
,
...
...
src/routes/User/Login.js
View file @
6ecfedde
...
...
@@ -61,7 +61,14 @@ export default class Login extends Component {
}
msg
=
(
message
)
=>
{
return
<
Alert
style
=
{{
marginBottom
:
16
}}
message
=
{
message
}
type
=
"
error
"
showIcon
closable
/>
;
return
(
<
Alert
key
=
{
new
Date
().
getTime
()}
style
=
{{
marginBottom
:
16
}}
message
=
{
message
}
type
=
"
error
"
showIcon
closable
/>
);
}
render
()
{
...
...
@@ -73,7 +80,12 @@ export default class Login extends Component {
<
Form
onSubmit
=
{
this
.
handleSubmit
}
>
<
Tabs
className
=
{
styles
.
tabs
}
activeKey
=
{
type
}
onChange
=
{
this
.
onSwitch
}
>
<
TabPane
tab
=
"
账ζ·ε―η η»ε½
"
key
=
"
account
"
>
{
login
.
status
===
'
error
'
&&
login
.
type
===
'
account
'
&&
this
.
msg
(
'
账ζ·ζε―η ιθ――
'
)}
{
login
.
status
===
'
error
'
&&
login
.
type
===
'
account
'
&&
login
.
submitting
===
false
&&
this
.
msg
(
'
账ζ·ζε―η ιθ――
'
)
}
<
FormItem
>
{
getFieldDecorator
(
'
userName
'
,
{
rules
:
[{
...
...
@@ -82,7 +94,7 @@ export default class Login extends Component {
})(
<
Input
prefix
=
{
<
Icon
type
=
"
user
"
style
=
{{
fontSize
:
14
,
color
:
'
rgba(0, 0, 0, 0.25)
'
}}
/>
}
placeholder
=
"
账ζ·
"
placeholder
=
"
admin
"
/>
)}
<
/FormItem
>
...
...
@@ -95,13 +107,18 @@ export default class Login extends Component {
<
Input
prefix
=
{
<
Icon
type
=
"
lock
"
style
=
{{
fontSize
:
14
,
color
:
'
rgba(0, 0, 0, 0.25)
'
}}
/>
}
type
=
"
password
"
placeholder
=
"
ε―η
"
placeholder
=
"
888888
"
/>
)}
<
/FormItem
>
<
/TabPane
>
<
TabPane
tab
=
"
ζζΊε·η»ε½
"
key
=
"
mobile
"
>
{
login
.
status
===
'
error
'
&&
login
.
type
===
'
mobile
'
&&
this
.
msg
(
'
ιͺθ―η ιθ――
'
)}
{
login
.
status
===
'
error
'
&&
login
.
type
===
'
mobile
'
&&
login
.
submitting
===
false
&&
this
.
msg
(
'
ιͺθ―η ιθ――
'
)
}
<
FormItem
>
{
getFieldDecorator
(
'
mobile
'
,
{
rules
:
[{
...
...
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