Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Accounts Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
Moecube Accounts Web
Commits
8e6b18fc
Commit
8e6b18fc
authored
Apr 01, 2017
by
nano
Browse files
Options
Browse Files
Download
Plain Diff
fix
parents
f7d1fb60
7ae37291
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
465 additions
and
365 deletions
+465
-365
.idea/workspace.xml
.idea/workspace.xml
+336
-271
i18n.json
i18n.json
+14
-7
src/components/EmailForm.js
src/components/EmailForm.js
+17
-13
src/components/PasswordForm.js
src/components/PasswordForm.js
+31
-20
src/components/SendEmail.js
src/components/SendEmail.js
+14
-9
src/components/UserNameForm.js
src/components/UserNameForm.js
+14
-10
src/index.js
src/index.js
+3
-8
src/routes/Activate.js
src/routes/Activate.js
+1
-1
src/routes/Forgot.js
src/routes/Forgot.js
+5
-6
src/routes/Login.js
src/routes/Login.js
+3
-3
src/routes/Profiles.js
src/routes/Profiles.js
+2
-2
src/routes/Register.js
src/routes/Register.js
+8
-8
src/routes/Reset.js
src/routes/Reset.js
+17
-7
No files found.
.idea/workspace.xml
View file @
8e6b18fc
This diff is collapsed.
Click to expand it.
i18n.json
View file @
8e6b18fc
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
"You can use this E-mail address."
:
"You can use this E-mail address."
,
"You can use this E-mail address."
:
"You can use this E-mail address."
,
"This user name has been token."
:
"This user name has been token."
,
"This user name has been token."
:
"This user name has been token."
,
"You can use this user name."
:
"You can use this user name."
,
"You can use this user name."
:
"You can use this user name."
,
"Password is not correct."
:
"Password is not correct."
,
"User does not exisit."
:
"User does not exisit."
,
"User does not exisit."
:
"User does not exisit."
,
"Incorrect password."
:
"Incorrect password."
,
"Incorrect password."
:
"Incorrect password."
,
"Please check your registration info again."
:
"Please check your registration info again."
,
"Please check your registration info again."
:
"Please check your registration info again."
,
...
@@ -68,12 +67,16 @@
...
@@ -68,12 +67,16 @@
"Please input your account!"
:
"Please input your email or username!"
,
"Please input your account!"
:
"Please input your email or username!"
,
"Please input your Password!"
:
"Please input your Password!"
,
"Please input your Password!"
:
"Please input your Password!"
,
"verify
email"
:
"verify email"
,
"verify
-
email"
:
"verify email"
,
"account-info"
:
"Account Info"
,
"account-info"
:
"Account Info"
,
"reset-username"
:
"Reset Username"
,
"reset-username"
:
"Reset Username"
,
"reset-email"
:
"Reset Email"
,
"reset-email"
:
"Reset Email"
,
"reset-password"
:
"Reset Password"
"reset-password"
:
"Reset Password"
,
"old-password"
:
"old password"
,
"new-password"
:
"new password"
,
"Password length must be between 8 and 24 characters"
:
"Password length must be between 8 and 24 characters"
,
"没毛用"
:
"防逗号报错,上线删"
},
},
"zh"
:
{
"zh"
:
{
"language"
:
"english"
,
"language"
:
"english"
,
...
@@ -84,7 +87,7 @@
...
@@ -84,7 +87,7 @@
"user-info"
:
"用户信息"
,
"user-info"
:
"用户信息"
,
"reset-info"
:
"修改信息"
,
"reset-info"
:
"修改信息"
,
"avatar"
:
"头像"
,
"avatar"
:
"头像"
,
"nickname"
:
"昵称
[选填]
"
,
"nickname"
:
"昵称"
,
"reset-account-info"
:
"修改账户信息"
,
"reset-account-info"
:
"修改账户信息"
,
"current_password"
:
"原密码"
,
"current_password"
:
"原密码"
,
"password-again"
:
"再次输入密码"
,
"password-again"
:
"再次输入密码"
,
...
@@ -124,7 +127,6 @@
...
@@ -124,7 +127,6 @@
"You can use this E-mail address."
:
"邮箱可以使用"
,
"You can use this E-mail address."
:
"邮箱可以使用"
,
"This user name has been token."
:
"该用户名已被注册"
,
"This user name has been token."
:
"该用户名已被注册"
,
"You can use this user name."
:
"用户名可以使用"
,
"You can use this user name."
:
"用户名可以使用"
,
"Password is not correct."
:
"密码不一致"
,
"User does not exisit."
:
"用户不存在"
,
"User does not exisit."
:
"用户不存在"
,
"Incorrect password."
:
"密码不正确"
,
"Incorrect password."
:
"密码不正确"
,
"Please check your registration info again."
:
"请填写正确的注册信息。"
,
"Please check your registration info again."
:
"请填写正确的注册信息。"
,
...
@@ -144,13 +146,18 @@
...
@@ -144,13 +146,18 @@
"Please input your account!"
:
"请填写你的邮箱或用户名!"
,
"Please input your account!"
:
"请填写你的邮箱或用户名!"
,
"Please input your Password!"
:
"请填写你的密码!"
,
"Please input your Password!"
:
"请填写你的密码!"
,
"verify
email"
:
"验证邮箱"
,
"verify
-
email"
:
"验证邮箱"
,
"account-info"
:
"账户信息"
,
"account-info"
:
"账户信息"
,
"reset-username"
:
"修改用户名"
,
"reset-username"
:
"修改用户名"
,
"reset-email"
:
"修改邮箱"
,
"reset-email"
:
"修改邮箱"
,
"reset-password"
:
"修改密码"
,
"reset-password"
:
"修改密码"
,
"old-password"
:
"原密码"
,
"new-password"
:
"新密码"
,
"Password length must be between 8 and 24 characters"
:
"密码必须为8-24位"
,
"Please confirm your password"
:
""
,
"密码至少为8-24位"
:
"密码至少为8-24位"
"密码至少为8-24位"
:
"密码至少为8-24位"
,
"没毛用"
:
"防逗号报错,上线删"
}
}
}
}
src/components/EmailForm.js
View file @
8e6b18fc
import
React
from
'
react
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
styles
from
'
./EmailForm.css
'
;
import
styles
from
'
./EmailForm.css
'
;
import
{
connect
}
from
'
react-redux
'
import
{
connect
}
from
'
react-redux
'
import
{
Form
,
Input
,
Icon
,
Button
}
from
'
antd
'
import
{
Form
,
Input
,
Icon
,
Button
}
from
'
antd
'
...
@@ -13,6 +13,9 @@ const formItemLayout = {
...
@@ -13,6 +13,9 @@ const formItemLayout = {
class
EmailForm
extends
React
.
Component
{
class
EmailForm
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
}
onSubmit
=
(
e
)
=>
{
onSubmit
=
(
e
)
=>
{
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
...
@@ -32,12 +35,13 @@ class EmailForm extends React.Component {
...
@@ -32,12 +35,13 @@ class EmailForm extends React.Component {
const
{
form
,
dispatch
,
user
,
checkEmail
,
isEmailExists
}
=
this
.
props
const
{
form
,
dispatch
,
user
,
checkEmail
,
isEmailExists
}
=
this
.
props
const
{
getFieldDecorator
}
=
form
const
{
getFieldDecorator
}
=
form
const
{
id
,
email
}
=
user
const
{
id
,
email
}
=
data
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
const
emailProps
=
{
const
emailProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
email
"
,
label
:
messages
.
email
,
hasFeedback
:
true
,
hasFeedback
:
true
,
validateStatus
:
checkEmail
,
validateStatus
:
checkEmail
,
help
:
isEmailExists
?
'
email exists
'
:
''
,
help
:
isEmailExists
?
'
email exists
'
:
''
,
...
@@ -47,22 +51,22 @@ class EmailForm extends React.Component {
...
@@ -47,22 +51,22 @@ class EmailForm extends React.Component {
initialValue
:
email
initialValue
:
email
},
},
input
:
{
input
:
{
placeholder
:
"
email
"
placeholder
:
messages
.
email
}
}
}
}
const
passwordProps
=
{
const
passwordProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
passwrod
"
,
label
:
messages
.
password
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
}
{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
}
]
]
},
},
input
:
{
input
:
{
placeholder
:
"
password
"
,
placeholder
:
messages
.
password
,
type
:
'
password
'
type
:
'
password
'
}
}
}
}
...
@@ -78,7 +82,7 @@ class EmailForm extends React.Component {
...
@@ -78,7 +82,7 @@ class EmailForm extends React.Component {
<
/FormItem
>
<
/FormItem
>
<
FormItem
{...
passwordProps
.
fromItem
}
>
<
FormItem
{...
passwordProps
.
fromItem
}
>
{
getFieldDecorator
(
`password`
,
{...
passwordProps
.
decorator
}
)(
{
getFieldDecorator
(
'
password
'
)(
<
Input
{...
passwordProps
.
input
}
/
>
<
Input
{...
passwordProps
.
input
}
/
>
)}
)}
<
/FormItem
>
<
/FormItem
>
...
...
src/components/PasswordForm.js
View file @
8e6b18fc
import
React
from
'
react
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
styles
from
'
./EmailForm.css
'
;
import
styles
from
'
./EmailForm.css
'
;
import
{
connect
}
from
'
react-redux
'
import
{
connect
}
from
'
react-redux
'
import
{
Form
,
Input
,
Icon
,
Button
}
from
'
antd
'
import
{
Form
,
Input
,
Icon
,
Button
}
from
'
antd
'
;
import
SubmitButton
from
'
./SubmitButton
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
import
SubmitButton
from
'
./SubmitButton
'
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
span
:
4
},
labelCol
:
{
span
:
4
},
...
@@ -13,6 +16,9 @@ const formItemLayout = {
...
@@ -13,6 +16,9 @@ const formItemLayout = {
class
EmailForm
extends
React
.
Component
{
class
EmailForm
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
}
checkPassword
=
(
rule
,
value
,
callback
)
=>
{
checkPassword
=
(
rule
,
value
,
callback
)
=>
{
const
form
=
this
.
props
.
form
;
const
form
=
this
.
props
.
form
;
if
(
value
&&
value
!==
form
.
getFieldValue
(
'
new_password
'
))
{
if
(
value
&&
value
!==
form
.
getFieldValue
(
'
new_password
'
))
{
...
@@ -48,53 +54,58 @@ class EmailForm extends React.Component {
...
@@ -48,53 +54,58 @@ class EmailForm extends React.Component {
render
(){
render
(){
const
{
form
}
=
this
.
props
const
{
form
}
=
this
.
props
const
{
getFieldDecorator
}
=
form
const
{
getFieldDecorator
}
=
form
;
const
{
intl
:
{
messages
}
}
=
this
.
context
const
passwordProps
=
{
const
passwordProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
passwrod
"
,
label
:
'
old passwrod
'
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
},
{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
},
{
validator
:
this
.
checkConfirm
}
{
validator
:
this
.
checkConfirm
}
]
]
,
},
},
input
:
{
input
:
{
placeholder
:
"
password
"
,
placeholder
:
messages
[
'
old-password
'
],
type
:
'
password
'
},
input2
:
{
placeholder
:
messages
[
'
new-password
'
],
type
:
'
password
'
type
:
'
password
'
}
}
}
}
const
confirmProps
=
{
const
confirmProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
comfirm
"
,
label
:
messages
[
'
password-again
'
],
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
},
{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
],
pattern
:
/^.
{8,24}
$/
},
{
validator
:
this
.
checkPassword
}
{
validator
:
this
.
checkPassword
}
]
]
,
},
},
input
:
{
input
:
{
placeholder
:
"
confirm
"
,
placeholder
:
messages
[
'
password-again
'
]
,
type
:
'
password
'
type
:
'
password
'
}
}
}
}
return
(
return
(
<
Form
onSubmit
=
{
this
.
onSubmit
}
>
<
Form
onSubmit
=
{
this
.
onSubmit
}
>
<
FormItem
{...
passwordProps
.
fromItem
}
label
=
"
old password
"
>
<
FormItem
{...
passwordProps
.
fromItem
}
label
=
{
messages
[
'
old-password
'
]}
>
{
getFieldDecorator
(
`password`
,
{...
passwordProps
.
decorator
}
)(
{
getFieldDecorator
(
'
password
'
)(
<
Input
{...
passwordProps
.
input
}
/
>
<
Input
{...
passwordProps
.
input
}
/
>
)}
)}
<
/FormItem
>
<
/FormItem
>
<
FormItem
{...
passwordProps
.
fromItem
}
label
=
"
new password
"
>
<
FormItem
{...
passwordProps
.
fromItem
}
label
=
{
messages
[
'
new-password
'
]}
>
{
getFieldDecorator
(
`new_password`
,
{...
passwordProps
.
decorator
})(
{
getFieldDecorator
(
'
new_password
'
,
{...
passwordProps
.
decorator
})(
<
Input
{...
passwordProps
.
input
}
/
>
<
Input
{...
passwordProps
.
input
2
}
/
>
)}
)}
<
/FormItem
>
<
/FormItem
>
...
...
src/components/SendEmail.js
View file @
8e6b18fc
import
React
from
'
react
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
styles
from
'
./EmailForm.css
'
;
import
styles
from
'
./EmailForm.css
'
;
import
{
connect
}
from
'
react-redux
'
import
{
connect
}
from
'
react-redux
'
import
{
Form
,
Input
,
Icon
,
Button
,
Modal
}
from
'
antd
'
import
{
Form
,
Input
,
Icon
,
Button
,
Modal
}
from
'
antd
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
import
SubmitButton
from
'
./SubmitButton
'
import
SubmitButton
from
'
./SubmitButton
'
;
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
span
:
4
},
labelCol
:
{
span
:
4
},
...
@@ -13,6 +13,10 @@ const formItemLayout = {
...
@@ -13,6 +13,10 @@ const formItemLayout = {
class
EmailForm
extends
React
.
Component
{
class
EmailForm
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
}
onSubmit
=
(
e
)
=>
{
onSubmit
=
(
e
)
=>
{
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
...
@@ -32,11 +36,12 @@ class EmailForm extends React.Component {
...
@@ -32,11 +36,12 @@ class EmailForm extends React.Component {
const
{
form
,
dispatch
,
user
,
checkEmail
,
isEmailExists
,
isSendEmailActive
}
=
this
.
props
const
{
form
,
dispatch
,
user
,
checkEmail
,
isEmailExists
,
isSendEmailActive
}
=
this
.
props
const
{
getFieldDecorator
}
=
form
;
const
{
getFieldDecorator
}
=
form
;
const
{
id
,
email
}
=
user
;
const
{
id
,
email
}
=
data
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
const
emailProps
=
{
const
emailProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
email
"
,
label
:
messages
.
email
,
hasFeedback
:
true
,
hasFeedback
:
true
,
validateStatus
:
checkEmail
,
validateStatus
:
checkEmail
,
help
:
isEmailExists
?
'
email exists
'
:
''
,
help
:
isEmailExists
?
'
email exists
'
:
''
,
...
@@ -46,22 +51,22 @@ class EmailForm extends React.Component {
...
@@ -46,22 +51,22 @@ class EmailForm extends React.Component {
initialValue
:
email
initialValue
:
email
},
},
input
:
{
input
:
{
placeholder
:
"
email
"
placeholder
:
messages
.
email
}
}
}
}
const
passwordProps
=
{
const
passwordProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
passwrod
"
,
label
:
messages
.
passwrod
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
}
{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
}
]
]
},
},
input
:
{
input
:
{
placeholder
:
"
password
"
,
placeholder
:
messages
.
password
,
type
:
'
password
'
type
:
'
password
'
}
}
}
}
...
...
src/components/UserNameForm.js
View file @
8e6b18fc
import
{
Form
,
Input
}
from
'
antd
'
;
import
{
Form
,
Input
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
SubmitButton
from
'
./SubmitButton
'
;
import
SubmitButton
from
'
./SubmitButton
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
span
:
4
},
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
15
},
wrapperCol
:
{
span
:
15
},
...
@@ -12,6 +12,9 @@ const formItemLayout = {
...
@@ -12,6 +12,9 @@ const formItemLayout = {
class
EmailForm
extends
React
.
Component
{
class
EmailForm
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
}
onSubmit
=
(
e
)
=>
{
onSubmit
=
(
e
)
=>
{
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
;
const
{
form
,
dispatch
,
user
:
{
id
}
}
=
this
.
props
;
...
@@ -31,11 +34,12 @@ class EmailForm extends React.Component {
...
@@ -31,11 +34,12 @@ class EmailForm extends React.Component {
const
{
form
,
dispatch
,
user
,
checkUsername
,
isUserNameExists
}
=
this
.
props
;
const
{
form
,
dispatch
,
user
,
checkUsername
,
isUserNameExists
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
{
getFieldDecorator
}
=
form
;
const
{
id
,
username
}
=
user
;
const
{
id
,
username
}
=
data
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
const
usernameProps
=
{
const
usernameProps
=
{
fromItem
:
{
fromItem
:
{
label
:
'
username
'
,
label
:
messages
.
username
,
hasFeedback
:
true
,
hasFeedback
:
true
,
validateStatus
:
checkUsername
,
validateStatus
:
checkUsername
,
help
:
isUserNameExists
?
'
username exists
'
:
''
,
help
:
isUserNameExists
?
'
username exists
'
:
''
,
...
@@ -45,23 +49,23 @@ class EmailForm extends React.Component {
...
@@ -45,23 +49,23 @@ class EmailForm extends React.Component {
initialValue
:
username
,
initialValue
:
username
,
},
},
input
:
{
input
:
{
placeholder
:
'
username
'
,
placeholder
:
messages
.
username
,
onBlur
:
()
=>
dispatch
({
type
:
'
auth/checkUsername
'
,
payload
:
{
...
form
.
getFieldsValue
(),
user_id
:
id
}
}),
onBlur
:
()
=>
dispatch
({
type
:
'
auth/checkUsername
'
,
payload
:
{
...
form
.
getFieldsValue
(),
user_id
:
id
}
}),
},
},
};
};
const
passwordProps
=
{
const
passwordProps
=
{
fromItem
:
{
fromItem
:
{
label
:
'
passwrod
'
,
label
:
messages
.
password
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
},
{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
},
],
],
},
},
input
:
{
input
:
{
placeholder
:
'
password
'
,
placeholder
:
messages
.
password
,
type
:
'
password
'
,
type
:
'
password
'
,
},
},
};
};
...
@@ -69,13 +73,13 @@ class EmailForm extends React.Component {
...
@@ -69,13 +73,13 @@ class EmailForm extends React.Component {
return
(
return
(
<
Form
onSubmit
=
{
this
.
onSubmit
}
>
<
Form
onSubmit
=
{
this
.
onSubmit
}
>
<
FormItem
{...
usernameProps
.
fromItem
}
>
<
FormItem
{...
usernameProps
.
fromItem
}
>
{
getFieldDecorator
(
`username`
,
{
...
usernameProps
.
decorator
})(
{
getFieldDecorator
(
'
username
'
,
{
...
usernameProps
.
decorator
})(
<
Input
{...
usernameProps
.
input
}
/>
,
<
Input
{...
usernameProps
.
input
}
/>
,
)}
)}
<
/FormItem
>
<
/FormItem
>
<
FormItem
{...
passwordProps
.
fromItem
}
>
<
FormItem
{...
passwordProps
.
fromItem
}
>
{
getFieldDecorator
(
`password`
,
{
...
passwordProps
.
decorator
}
)(
{
getFieldDecorator
(
'
password
'
)(
<
Input
{...
passwordProps
.
input
}
/>
,
<
Input
{...
passwordProps
.
input
}
/>
,
)}
)}
<
/FormItem
>
<
/FormItem
>
...
...
src/index.js
View file @
8e6b18fc
...
@@ -51,16 +51,13 @@ app.router(require('./router'));
...
@@ -51,16 +51,13 @@ app.router(require('./router'));
addLocaleData
([...
en
,
...
zh
]);
addLocaleData
([...
en
,
...
zh
]);
/*eslint-disable */
/*eslint-disable */
let
language
=
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
let
language
=
localStorage
.
getItem
(
'
locale
'
)
||
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
/*eslint-enable */
/*eslint-enable */
const
languageWithoutRegionCode
=
language
.
toLowerCase
().
split
(
/
[
_-
]
+/
)[
0
];
const
languageWithoutRegionCode
=
language
.
toLowerCase
().
split
(
/
[
_-
]
+/
)[
0
];
language
=
(
localeData
[
languageWithoutRegionCode
]
||
localeData
[
language
])
?
language
:
'
zh-CN
'
;
const
messages
=
localeData
[
languageWithoutRegionCode
]
||
localeData
[
language
]
||
localeData
.
zh
;
const
messages
=
localeData
[
languageWithoutRegionCode
]
||
localeData
[
language
]
||
localeData
.
zh
;
if
(
localStorage
.
getItem
(
'
locale
'
)){
language
=
JSON
.
parse
(
localStorage
.
getItem
(
'
locale
'
))
}
const
App
=
app
.
start
();
const
App
=
app
.
start
();
ReactDOM
.
render
(
ReactDOM
.
render
(
<
IntlProvider
locale
=
{
language
}
messages
=
{
messages
}
>
<
IntlProvider
locale
=
{
language
}
messages
=
{
messages
}
>
...
@@ -69,5 +66,3 @@ ReactDOM.render(
...
@@ -69,5 +66,3 @@ ReactDOM.render(
document
.
getElementById
(
'
root
'
),
document
.
getElementById
(
'
root
'
),
);
);
console
.
log
(
language
);
src/routes/Activate.js
View file @
8e6b18fc
...
@@ -16,7 +16,7 @@ class Active extends React.Component {
...
@@ -16,7 +16,7 @@ class Active extends React.Component {
return
(
return
(
<
div
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
minHeight
:
'
100%
'
}}
>
<
div
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
minHeight
:
'
100%
'
}}
>
<
Button
type
=
"
primary
"
icon
=
"
poweroff
"
loading
=
{
loading
}
onClick
=
{
this
.
handleClick
}
>
<
Button
type
=
"
primary
"
icon
=
"
poweroff
"
loading
=
{
loading
}
onClick
=
{
this
.
handleClick
}
>
<
Format
id
=
{
'
verify
email
'
}
/
>
<
Format
id
=
{
'
verify
-
email
'
}
/
>
<
/Button
>
<
/Button
>
<
/div
>
<
/div
>
);
);
...
...
src/routes/Forgot.js
View file @
8e6b18fc
...
@@ -51,8 +51,8 @@ class Login extends React.Component {
...
@@ -51,8 +51,8 @@ class Login extends React.Component {
<
Form
onSubmit
=
{
this
.
onSubmitLogin
}
className
=
"
login-form
"
>
<
Form
onSubmit
=
{
this
.
onSubmitLogin
}
className
=
"
login-form
"
>
<
Steps
size
=
"
large
"
current
=
{
0
}
>
<
Steps
size
=
"
large
"
current
=
{
0
}
>
<
Step
title
=
"
Sent Email
"
icon
=
{
<
Icon
type
=
"
solution
"
/>
}
/
>
<
Step
title
=
{
messages
[
'
send-email
'
]}
icon
=
{
<
Icon
type
=
"
solution
"
/>
}
/
>
<
Step
title
=
"
Verify Email
"
icon
=
{
<
Icon
type
=
"
mail
"
/>
}
/
>
<
Step
title
=
{
messages
[
'
verify-email
'
]}
icon
=
{
<
Icon
type
=
"
mail
"
/>
}
/
>
<
/Steps
>
<
/Steps
>
<
FormItem
style
=
{{
marginTop
:
'
28px
'
}}
>
<
FormItem
style
=
{{
marginTop
:
'
28px
'
}}
>
...
@@ -62,13 +62,12 @@ class Login extends React.Component {
...
@@ -62,13 +62,12 @@ class Login extends React.Component {
<
Input
prefix
=
{
<
Icon
type
=
"
user
"
style
=
{{
fontSize
:
13
}}
/>} placeholder={messages
[
'email-address-or-username'
]
} /
>
,
<
Input
prefix
=
{
<
Icon
type
=
"
user
"
style
=
{{
fontSize
:
13
}}
/>} placeholder={messages
[
'email-address-or-username'
]
} /
>
,
)}
)}
<
/FormItem
>
<
/FormItem
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Format
id
=
{
'
send-email
'
}
/
>
<
Format
id
=
{
'
send-email
'
}
/
>
<
/Button
>
<
/Button
>
<
FormItem
>
<
div
>
<
Link
to
=
"
/signin
"
><
Format
id
=
{
'
sign-in
'
}
/></
Link
>
<
Link
to
=
"
/signin
"
><
Format
id
=
{
'
sign-in
'
}
/></
Link
>
<
/
FormItem
>
<
/
div
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
<
/div
>
<
/div
>
...
...
src/routes/Login.js
View file @
8e6b18fc
...
@@ -58,10 +58,10 @@ class Login extends React.Component {
...
@@ -58,10 +58,10 @@ class Login extends React.Component {
<
Format
id
=
{
'
sign-in
'
}
/
>
<
Format
id
=
{
'
sign-in
'
}
/
>
<
/Button
>
<
/Button
>
<
/FormItem
>
<
/FormItem
>
<
Form
>
<
div
>
<
Link
to
=
"
/signup
"
><
Format
id
=
{
'
sign-up
'
}
/></
Link
>
<
Link
to
=
"
/signup
"
><
Format
id
=
{
'
sign-up
'
}
/></
Link
>
<
Link
to
=
"
/forgot
"
className
=
"
login-form-forgot
"
><
Format
id
=
{
'
forgot-password
'
}
/></
Link
>
<
Link
to
=
"
/forgot
"
className
=
"
login-form-forgot
"
><
Format
id
=
{
'
forgot-password
'
}
/></
Link
>
<
/
Form
>
<
/
div
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
<
/div
>
<
/div
>
...
...
src/routes/Profiles.js
View file @
8e6b18fc
...
@@ -83,14 +83,14 @@ class Profiles extends React.Component {
...
@@ -83,14 +83,14 @@ class Profiles extends React.Component {
const
nameProps
=
{
const
nameProps
=
{
fromItem
:
{
fromItem
:
{
label
:
'
name
'
,
label
:
messages
[
'
nickname
'
]
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
initialValue
:
name
initialValue
:
name
},
},
input
:
{
input
:
{
placeholder
:
'
name
'
,
placeholder
:
messages
[
'
nickname
'
]
,
}
}
}
}
...
...
src/routes/Register.js
View file @
8e6b18fc
...
@@ -81,8 +81,8 @@ class Register extends React.Component {
...
@@ -81,8 +81,8 @@ class Register extends React.Component {
<
Spin
spinning
=
{
loading
}
delay
=
{
100
}
>
<
Spin
spinning
=
{
loading
}
delay
=
{
100
}
>
<
Steps
size
=
"
large
"
current
=
{
0
}
>
<
Steps
size
=
"
large
"
current
=
{
0
}
>
<
Step
title
=
"
register
"
icon
=
{
<
Icon
type
=
"
solution
"
/>
}
/
>
<
Step
title
=
{
messages
[
'
sign-up
'
]}
icon
=
{
<
Icon
type
=
"
solution
"
/>
}
/
>
<
Step
title
=
"
verify Email
"
icon
=
{
<
Icon
type
=
"
mail
"
/>
}
/
>
<
Step
title
=
{
messages
[
'
verify-email
'
]}
icon
=
{
<
Icon
type
=
"
mail
"
/>
}
/
>
<
/Steps
>
<
/Steps
>
<
Form
onSubmit
=
{
this
.
onSubmitLogin
}
className
=
"
login-form
"
style
=
{{
marginTop
:
'
24px
'
}}
>
<
Form
onSubmit
=
{
this
.
onSubmitLogin
}
className
=
"
login-form
"
style
=
{{
marginTop
:
'
24px
'
}}
>
...
@@ -112,7 +112,7 @@ class Register extends React.Component {
...
@@ -112,7 +112,7 @@ class Register extends React.Component {
<
FormItem
hasFeedback
>
<
FormItem
hasFeedback
>
{
getFieldDecorator
(
'
password
'
,
{
{
getFieldDecorator
(
'
password
'
,
{
rules
:
[{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
}],
rules
:
[{
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
}],
},
{
},
{
validator
:
this
.
checkConfirm
,
validator
:
this
.
checkConfirm
,
})(
})(
...
@@ -126,7 +126,7 @@ class Register extends React.Component {
...
@@ -126,7 +126,7 @@ class Register extends React.Component {
<
FormItem
hasFeedback
>
<
FormItem
hasFeedback
>
{
getFieldDecorator
(
'
confirm
'
,
{
{
getFieldDecorator
(
'
confirm
'
,
{
rules
:
[{
rules
:
[{
required
:
true
,
message
:
'
密码至少为8-24位
'
,
pattern
:
/^.
{8,24}
$/
,
required
:
true
,
message
:
messages
[
'
Password length must be between 8 and 24 characters
'
]
,
pattern
:
/^.
{8,24}
$/
,
},
{
},
{
validator
:
this
.
checkPassword
,
validator
:
this
.
checkPassword
,
}],
}],
...
@@ -142,9 +142,9 @@ class Register extends React.Component {
...
@@ -142,9 +142,9 @@ class Register extends React.Component {
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Format
id
=
{
'
sign-up
'
}
/
>
<
Format
id
=
{
'
sign-up
'
}
/
>
<
/Button
>
<
/Button
>
<
FormItem
>
<
div
>
<
Link
to
=
"
/signin
"
><
Format
id
=
{
'
sign-in
'
}
/></
Link
>
<
Link
to
=
"
/signin
"
><
Format
id
=
{
'
sign-in
'
}
/></
Link
>
<
/
FormItem
>
<
/
div
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
<
/div
>
<
/div
>
...
...
src/routes/Reset.js
View file @
8e6b18fc
import
{
Button
,
Form
,
Icon
,
Input
,
Select
,
Spin
}
from
'
antd
'
;
import
{
Button
,
Form
,
Icon
,
Input
,
Select
,
Spin
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
React
from
'
react
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
Option
=
Select
.
Option
;
const
Option
=
Select
.
Option
;
class
Reset
extends
React
.
Component
{
class
Reset
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
};
onSubmitReset
=
(
e
)
=>
{
onSubmitReset
=
(
e
)
=>
{
const
{
form
,
dispatch
,
location
:
{
query
:
{
key
,
user_id
}
}
}
=
this
.
props
;
const
{
form
,
dispatch
,
location
:
{
query
:
{
key
,
user_id
}
}
}
=
this
.
props
;
...
@@ -43,35 +48,40 @@ class Reset extends React.Component {
...
@@ -43,35 +48,40 @@ class Reset extends React.Component {
render
()
{
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
isResetSubmit
=
false
}
=
this
.
props
;
const
{
isResetSubmit
=
false
}
=
this
.
props
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
return
(
return
(
<
div
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
height
:
'
100%
'
}}
>
<
div
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
height
:
'
100%
'
}}
>
<
Spin
spinning
=
{
isResetSubmit
}
delay
=
{
100
}
>
<
Spin
spinning
=
{
isResetSubmit
}
delay
=
{
100
}
>
<
Form
onSubmit
=
{
this
.
onSubmitReset
}
className
=
"
login-form
"
>
<
Form
onSubmit
=
{
this
.
onSubmitReset
}
className
=
"
login-form
"
>
<
FormItem
>
<
h1
><
Format
id
=
'
reset-password
'
/><
/h1
>
<
/FormItem
>
<
FormItem
>
<
FormItem
>
{
getFieldDecorator
(
'
password
'
,
{
{
getFieldDecorator
(
'
password
'
,
{
rules
:
[{
required
:
true
,
message
:
'
Please input your Password!
'
}],
rules
:
[{
required
:
true
,
message
:
messages
[
'
Password can not be blank
'
]
}],
},
{
},
{
validator
:
this
.
checkConfirm
,
validator
:
this
.
checkConfirm
,
})(
})(
<
Input
prefix
=
{
<
Icon
type
=
"
lock
"
style
=
{{
fontSize
:
13
}}
/>} type="password" placeholder="Password"/
>
,
<
Input
prefix
=
{
<
Icon
type
=
"
lock
"
style
=
{{
fontSize
:
13
}}
/>} type="password
"
placeholder
=
{
messages
.
password
}
/>
,
)}
)}
<
/FormItem
>
<
/FormItem
>
<
FormItem
>
<
FormItem
>
{
getFieldDecorator
(
'
confirm
'
,
{
{
getFieldDecorator
(
'
confirm
'
,
{
rules
:
[{
rules
:
[{
required
:
true
,
message
:
'
Please confirm your password!
'
,
required
:
true
,
message
:
messages
[
'
Incorrect password.2
'
]
,
},
{
},
{
validator
:
this
.
checkPassword
,
validator
:
this
.
checkPassword
,
}],
}],
})(
})(
<
Input
type
=
"
password
"
onBlur
=
{
this
.
handleConfirmBlur
}
placeholder
=
"
Password Again
"
/>
,
<
Input
type
=
"
password
"
onBlur
=
{
this
.
handleConfirmBlur
}
placeholder
=
{
messages
[
'
password-again
'
]}
/>
,
)}
)}
<
/FormItem
>
<
/FormItem
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
Submit
<
Format
id
=
'
reset-password
'
/>
<
/Button
>
<
/Button
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
...
...
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