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
a86acf53
Commit
a86acf53
authored
Mar 31, 2017
by
2breakegg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i18n
parent
57f88105
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
62 additions
and
48 deletions
+62
-48
i18n.json
i18n.json
+19
-8
src/index.js
src/index.js
+16
-17
src/routes/Activate.js
src/routes/Activate.js
+2
-1
src/routes/Forgot.js
src/routes/Forgot.js
+1
-1
src/routes/Login.js
src/routes/Login.js
+2
-4
src/routes/Profiles.js
src/routes/Profiles.js
+19
-13
src/routes/Register.js
src/routes/Register.js
+2
-2
src/routes/Reset.js
src/routes/Reset.js
+1
-0
src/services/auth.js
src/services/auth.js
+0
-2
No files found.
i18n.json
View file @
a86acf53
...
@@ -18,12 +18,11 @@
...
@@ -18,12 +18,11 @@
"moecube"
:
"MoeCube"
,
"moecube"
:
"MoeCube"
,
"index-leftbox1"
:
"You can use this account to sign in."
,
"index-leftbox1"
:
"You can use this account to sign in."
,
"yonghuan"
:
"The Disappearing of Gensokyo"
,
"yonghuan"
:
"The Disappearing of Gensokyo"
,
"
please-
sign-up"
:
"Sign Up"
,
"sign-up"
:
"Sign Up"
,
"
please-
sign-in"
:
"Sign In"
,
"sign-in"
:
"Sign In"
,
"email-address-or-username"
:
"E-Mail or Username"
,
"email-address-or-username"
:
"E-Mail or Username"
,
"register-now"
:
"register-now!"
,
"register-now"
:
"register-now!"
,
"register"
:
"register"
,
"register"
:
"register"
,
"login"
:
"Login"
,
"forgot-password"
:
"Forgot Password"
,
"forgot-password"
:
"Forgot Password"
,
"send-email"
:
"Send Email"
,
"send-email"
:
"Send Email"
,
"reset-success"
:
"reset success"
,
"reset-success"
:
"reset success"
,
...
@@ -67,7 +66,13 @@
...
@@ -67,7 +66,13 @@
"Your email has been updated."
:
"Your email has been updated. You will receive an verification email. Please check the mail to finish verification. "
,
"Your email has been updated."
:
"Your email has been updated. You will receive an verification email. Please check the mail to finish verification. "
,
"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"
,
"account-info"
:
"Account Info"
,
"reset-username"
:
"Reset Username"
,
"reset-email"
:
"Reset Email"
,
"reset-password"
:
"Reset Password"
},
},
"zh"
:
{
"zh"
:
{
...
@@ -89,12 +94,11 @@
...
@@ -89,12 +94,11 @@
"moecube"
:
"萌立方"
,
"moecube"
:
"萌立方"
,
"index-leftbox1"
:
"您可使用以下几种账号登陆"
,
"index-leftbox1"
:
"您可使用以下几种账号登陆"
,
"yonghuan"
:
"永远消失的幻想乡"
,
"yonghuan"
:
"永远消失的幻想乡"
,
"
please-
sign-up"
:
"注册"
,
"sign-up"
:
"注册"
,
"
please-
sign-in"
:
"登陆"
,
"sign-in"
:
"登陆"
,
"email-address-or-username"
:
"邮箱或用户名"
,
"email-address-or-username"
:
"邮箱或用户名"
,
"register-now"
:
"现在注册"
,
"register-now"
:
"现在注册"
,
"register"
:
"注册"
,
"register"
:
"注册"
,
"login"
:
"登陆"
,
"forgot-password"
:
"忘记密码"
,
"forgot-password"
:
"忘记密码"
,
"send-email"
:
"发送邮件"
,
"send-email"
:
"发送邮件"
,
"reset-success"
:
"修改成功"
,
"reset-success"
:
"修改成功"
,
...
@@ -139,7 +143,14 @@
...
@@ -139,7 +143,14 @@
"Please input your account!"
:
"请填写你的邮箱或用户名!"
,
"Please input your account!"
:
"请填写你的邮箱或用户名!"
,
"Please input your Password!"
:
"请填写你的密码!"
,
"Please input your Password!"
:
"请填写你的密码!"
,
"密码至少为8-24位"
:
"密码至少为8-24位"
"verify email"
:
"验证邮箱"
,
"account-info"
:
"账户信息"
,
"reset-username"
:
"修改用户名"
,
"reset-email"
:
"修改邮箱"
,
"reset-password"
:
"修改密码"
,
"密码至少为8-24位"
:
"密码至少为8-24位"
}
}
}
}
src/index.js
View file @
a86acf53
import
{
message
}
from
'
antd
'
;
import
dva
from
'
dva
'
;
import
dva
from
'
dva
'
;
import
{
browserHistory
}
from
'
dva/router
'
;
import
ReactDOM
from
'
react-dom
'
;
import
ReactDOM
from
'
react-dom
'
;
import
{
browserHistory
}
from
'
dva/router
'
import
{
message
}
from
'
antd
'
import
'
./index.css
'
;
import
{
IntlProvider
,
addLocaleData
}
from
'
react-intl
'
;
import
{
addLocaleData
,
IntlProvider
}
from
'
react-intl
'
;
// 5. Start
import
en
from
'
react-intl/locale-data/en
'
;
import
zh
from
'
react-intl/locale-data/zh
'
;
import
localeData
from
'
../i18n.json
'
;
import
'
./index.css
'
;
// 1. Initialize
// 1. Initialize
const
app
=
dva
({
const
app
=
dva
({
onError
:
(
error
,
dispatch
)
=>
{
onError
:
(
error
,
dispatch
)
=>
{
message
.
destroy
();
message
.
destroy
();
message
.
error
(
error
.
message
);
message
.
error
(
error
.
message
);
},
},
history
:
browserHistory
history
:
browserHistory
,
});
});
...
@@ -36,27 +40,22 @@ app.model(require('./models/common'));
...
@@ -36,27 +40,22 @@ app.model(require('./models/common'));
// 4. Router
// 4. Router
app
.
router
(
require
(
'
./router
'
));
app
.
router
(
require
(
'
./router
'
));
// 5. Start
import
en
from
'
react-intl/locale-data/en
'
import
zh
from
'
react-intl/locale-data/zh
'
import
localeData
from
'
../i18n.json
'
addLocaleData
([...
en
,
...
zh
]);
addLocaleData
([...
en
,
...
zh
]);
/*eslint-disable */
/*eslint-disable */
const
language
=
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
const
language
=
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
/*eslint-enable */
/*eslint-enable */
const
languageWithoutRegionCode
=
language
.
toLowerCase
().
split
(
/
[
_-
]
+/
)[
0
];
const
languageWithoutRegionCode
=
'
zh
'
||
language
.
toLowerCase
().
split
(
/
[
_-
]
+/
)[
0
];
const
messages
=
localeData
[
languageWithoutRegionCode
]
||
localeData
[
language
]
||
localeData
.
zh
;
const
messages
=
localeData
[
languageWithoutRegionCode
]
||
localeData
[
language
]
||
localeData
.
zh
;
const
App
=
app
.
start
();
const
App
=
app
.
start
();
ReactDOM
.
render
(
ReactDOM
.
render
(
<
IntlProvider
locale
=
{
language
}
messages
=
{
messages
}
>
<
IntlProvider
locale
=
{
language
}
messages
=
{
messages
}
>
<
App
/>
<
App
/>
<
/IntlProvider>
,
<
/IntlProvider>
,
document
.
getElementById
(
'
root
'
),
document
.
getElementById
(
'
root
'
),
);
);
console
.
log
(
language
)
console
.
log
(
language
)
;
src/routes/Activate.js
View file @
a86acf53
import
{
Button
}
from
'
antd
'
;
import
{
Button
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
class
Active
extends
React
.
Component
{
class
Active
extends
React
.
Component
{
...
@@ -15,7 +16,7 @@ class Active extends React.Component {
...
@@ -15,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
=
{
activateState
}
onClick
=
{
this
.
handleClick
}
>
<
Button
type
=
"
primary
"
icon
=
"
poweroff
"
loading
=
{
activateState
}
onClick
=
{
this
.
handleClick
}
>
激活
<
Format
id
=
{
'
verify email
'
}
/
>
<
/Button
>
<
/Button
>
<
/div
>
<
/div
>
);
);
...
...
src/routes/Forgot.js
View file @
a86acf53
...
@@ -60,7 +60,7 @@ class Login extends React.Component {
...
@@ -60,7 +60,7 @@ class Login extends React.Component {
<
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
>
Or
<
Link
to
=
"
/login
"
><
Format
id
=
{
'
log
in
'
}
/></
Link
>
Or
<
Link
to
=
"
/login
"
><
Format
id
=
{
'
sign-
in
'
}
/></
Link
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
<
/div
>
<
/div
>
...
...
src/routes/Login.js
View file @
a86acf53
...
@@ -61,9 +61,9 @@ class Login extends React.Component {
...
@@ -61,9 +61,9 @@ class Login extends React.Component {
)}
)}
<
Link
to
=
"
/forgot
"
className
=
"
login-form-forgot
"
><
Format
id
=
{
'
forgot-password
'
}
/></
Link
>
<
Link
to
=
"
/forgot
"
className
=
"
login-form-forgot
"
><
Format
id
=
{
'
forgot-password
'
}
/></
Link
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Format
id
=
{
'
log
in
'
}
/
>
<
Format
id
=
{
'
sign-
in
'
}
/
>
<
/Button
>
<
/Button
>
Or
<
Link
to
=
"
/register
"
><
Format
id
=
{
'
register-now
'
}
/></
Link
>
Or
<
Link
to
=
"
/register
"
><
Format
id
=
{
'
sign-up
'
}
/></
Link
>
<
/FormItem
>
<
/FormItem
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
...
@@ -74,11 +74,9 @@ class Login extends React.Component {
...
@@ -74,11 +74,9 @@ class Login extends React.Component {
function
mapStateToProps
(
state
)
{
function
mapStateToProps
(
state
)
{
const
{
const
{
common
:
{
language
},
auth
:
{
isLoginSubmit
},
auth
:
{
isLoginSubmit
},
}
=
state
;
}
=
state
;
return
{
return
{
language
,
isLoginSubmit
,
isLoginSubmit
,
};
};
}
}
...
...
src/routes/Profiles.js
View file @
a86acf53
import
{
Button
,
Form
,
Icon
,
Input
,
Spin
,
Tabs
}
from
'
antd
'
;
import
{
Button
,
Form
,
Icon
,
Input
,
Spin
,
Tabs
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
React
from
'
react
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
EmailForm
from
'
../components/EmailForm
'
;
import
EmailForm
from
'
../components/EmailForm
'
;
import
PasswordForm
from
'
../components/PasswordForm
'
;
import
PasswordForm
from
'
../components/PasswordForm
'
;
import
UserNameForm
from
'
../components/UserNameForm
'
;
import
UserNameForm
from
'
../components/UserNameForm
'
;
...
@@ -17,6 +18,10 @@ const formItemLayout = {
...
@@ -17,6 +18,10 @@ const formItemLayout = {
class
Profiles
extends
React
.
Component
{
class
Profiles
extends
React
.
Component
{
static
contextTypes
=
{
intl
:
PropTypes
.
object
.
isRequired
,
}
onUpdateSubmit
=
(
e
)
=>
{
onUpdateSubmit
=
(
e
)
=>
{
const
{
form
,
dispatch
,
data
:
{
id
}
}
=
this
.
props
;
const
{
form
,
dispatch
,
data
:
{
id
}
}
=
this
.
props
;
...
@@ -33,27 +38,28 @@ class Profiles extends React.Component {
...
@@ -33,27 +38,28 @@ class Profiles extends React.Component {
};
};
render
()
{
render
()
{
const
{
dispatch
,
form
,
data
,
isUpdateSubmit
=
false
,
checkUsername
,
isUserNameExists
}
=
this
.
props
const
{
dispatch
,
form
,
data
,
isUpdateSubmit
=
false
,
checkUsername
,
isUserNameExists
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
{
getFieldDecorator
}
=
form
;
const
{
username
,
name
,
id
}
=
data
const
{
username
,
name
,
id
}
=
data
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
const
nameProps
=
{
const
nameProps
=
{
fromItem
:
{
fromItem
:
{
label
:
"
name
"
,
label
:
'
name
'
,
...
formItemLayout
...
formItemLayout
},
},
decorator
:
{
decorator
:
{
initialValue
:
name
initialValue
:
name
},
},
input
:
{
input
:
{
placeholder
:
"
name
"
,
placeholder
:
'
name
'
,
}
}
}
}
return
(
return
(
<
Spin
spinning
=
{
isUpdateSubmit
}
delay
=
{
500
}
>
<
Spin
spinning
=
{
isUpdateSubmit
}
delay
=
{
500
}
>
<
Tabs
defaultActiveKey
=
"
1
"
className
=
"
app-detail-nav
"
>
<
Tabs
defaultActiveKey
=
"
1
"
className
=
"
app-detail-nav
"
>
<
TabPane
tab
=
{
<
span
><
Icon
type
=
"
setting
"
/>
基本信息
<
/span>} key="1"
>
<
TabPane
tab
=
{
<
span
><
Icon
type
=
"
setting
"
/>
<
Format
id
=
{
'
user-info
'
}
/>
</
span
>
}
key
=
"
1
"
>
<
Form
onSubmit
=
{
this
.
onUpdateSubmit
}
>
<
Form
onSubmit
=
{
this
.
onUpdateSubmit
}
>
<
FormItem
{...
nameProps
.
fromItem
}
>
<
FormItem
{...
nameProps
.
fromItem
}
>
...
@@ -64,24 +70,24 @@ class Profiles extends React.Component {
...
@@ -64,24 +70,24 @@ class Profiles extends React.Component {
<
FormItem
>
<
FormItem
>
<
div
className
=
{
styles
.
wrapSubmit
}
>
<
div
className
=
{
styles
.
wrapSubmit
}
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
size
=
"
large
"
>
提交
<
/Button
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
size
=
"
large
"
>
<
Format
id
=
{
'
save
'
}
/>
</
Button
>
<
/div
>
<
/div
>
<
/FormItem
>
<
/FormItem
>
<
/Form
>
<
/Form
>
<
/TabPane
>
<
/TabPane
>
<
TabPane
tab
=
{
<
span
><
Icon
type
=
"
setting
"
/>
账户信息
<
/span>} key="2"
>
<
TabPane
tab
=
{
<
span
><
Icon
type
=
"
setting
"
/>
<
Format
id
=
{
'
account-info
'
}
/>
</
span
>
}
key
=
"
2
"
>
<
Tabs
type
=
"
card
"
className
=
"
app-detail-nav
"
>
<
Tabs
type
=
"
card
"
className
=
"
app-detail-nav
"
>
<
TabPane
tab
=
{
'
修改用户名
'
}
key
=
{
0
}
>
<
TabPane
tab
=
{
messages
[
'
reset-username
'
]
}
key
=
{
0
}
>
<
UserNameForm
/>
<
UserNameForm
/>
<
/TabPane
>
<
/TabPane
>
<
TabPane
tab
=
{
'
修改邮箱
'
}
key
=
{
1
}
>
<
TabPane
tab
=
{
messages
[
'
reset-email
'
]}
key
=
{
1
}
>
<
EmailForm
/>
<
EmailForm
/>
<
/TabPane
>
<
/TabPane
>
<
TabPane
tab
=
{
'
修改密码
'
}
key
=
{
2
}
>
<
TabPane
tab
=
{
messages
[
'
reset-password
'
]}
key
=
{
2
}
>
<
PasswordForm
/>
<
PasswordForm
/>
<
/TabPane
>
<
/TabPane
>
<
/Tabs
>
<
/Tabs
>
...
...
src/routes/Register.js
View file @
a86acf53
...
@@ -138,9 +138,9 @@ class Register extends React.Component {
...
@@ -138,9 +138,9 @@ class Register extends React.Component {
<
/FormItem
>
<
/FormItem
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
className
=
"
login-form-button
"
>
<
Format
id
=
{
'
register
'
}
/
>
<
Format
id
=
{
'
sign-up
'
}
/
>
<
/Button
>
<
/Button
>
Or
<
Link
to
=
"
/login
"
><
Format
id
=
{
'
log
in
'
}
/></
Link
>
Or
<
Link
to
=
"
/login
"
><
Format
id
=
{
'
sign-
in
'
}
/></
Link
>
<
/Form
>
<
/Form
>
<
/Spin
>
<
/Spin
>
<
/div
>
<
/div
>
...
...
src/routes/Reset.js
View file @
a86acf53
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
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
Option
=
Select
.
Option
;
const
Option
=
Select
.
Option
;
...
...
src/services/auth.js
View file @
a86acf53
...
@@ -56,5 +56,3 @@ export async function checkUserExists(params) {
...
@@ -56,5 +56,3 @@ export async function checkUserExists(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