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
65c02fb0
Commit
65c02fb0
authored
Apr 06, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7ceb460f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
50 deletions
+48
-50
.roadhogrc.js
.roadhogrc.js
+1
-1
i18n.json
i18n.json
+0
-1
package.json
package.json
+3
-3
src/models/user.js
src/models/user.js
+12
-2
src/routes/Index.js
src/routes/Index.js
+1
-1
src/routes/Login.js
src/routes/Login.js
+1
-1
src/routes/Profiles.js
src/routes/Profiles.js
+25
-37
src/routes/Register.js
src/routes/Register.js
+5
-4
No files found.
.roadhogrc.js
View file @
65c02fb0
let
publicPath
=
'
https://cdn01.moecube.com/accounts/
'
let
defineConf
=
{
apiRoot
:
process
.
env
[
"
BUILD
"
]
==
'
development
'
?
'
http://114.215.243.95:8082
'
:
'
https://api.moeube.com/accounts
'
apiRoot
:
process
.
env
[
"
API_ROOT
"
]
}
export
default
{
...
...
i18n.json
View file @
65c02fb0
...
...
@@ -159,7 +159,6 @@
"i_not_found"
:
"用户不存在"
,
"i_key_time_out"
:
"此链接已过期"
,
"i_key_invalid"
:
"此链接已失效"
,
"没毛用"
:
"防逗号报错,上线删"
}
...
...
package.json
View file @
65c02fb0
{
"private"
:
true
,
"scripts"
:
{
"start"
:
"cross-env
BUILD=development
roadhog server"
,
"build:dev"
:
"cross-env
BUILD=development
roadhog build"
,
"build"
:
"roadhog build"
,
"start"
:
"cross-env
API_ROOT=http://192.168.1.9:3000
roadhog server"
,
"build:dev"
:
"cross-env
API_ROOT=http://114.215.243.95:8082
roadhog build"
,
"build"
:
"
cross-env API_ROOT=https://api.moeube.com/accounts
roadhog build"
,
"lint"
:
"eslint --ext .js src test"
,
"precommit"
:
"npm run lint"
},
...
...
src/models/user.js
View file @
65c02fb0
...
...
@@ -144,7 +144,7 @@ export default {
if
(
data
.
active
)
{
yield
put
(
routerRedux
.
replace
(
'
/profiles
'
));
}
else
{
yield
put
(
routerRedux
.
replace
(
'
/
verify
'
));
yield
put
(
routerRedux
.
replace
(
'
/
signin
'
));
}
}
}
catch
(
error
)
{
...
...
@@ -204,11 +204,21 @@ export default {
const
token
=
localStorage
.
getItem
(
'
token
'
);
if
(
token
)
{
dispatch
({
type
:
'
getAuthUser
'
,
payload
:
{
token
}
});
}
else
{
if
(
location
.
pathname
==
'
/profiles
'
)
{
dispatch
(
routerRedux
.
replace
(
'
/signin
'
))
}
}
history
.
listen
(({
pathname
})
=>
{
history
.
listen
(({
pathname
,
query
})
=>
{
if
(
pathname
===
'
/
'
)
{
dispatch
({
type
:
'
preLogin
'
,
payload
:
{
token
}
});
}
if
(
pathname
===
'
/reset
'
||
pathname
==
"
/activate
"
){
if
(
!
query
[
"
key
"
])
{
message
.
error
(
"
缺少参数
"
)
}
}
});
},
},
...
...
src/routes/Index.js
View file @
65c02fb0
...
...
@@ -124,7 +124,7 @@ const particleConfig = {
function
Index
({
children
,
messages
,
dispatch
})
{
return
(
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flex
Grow
:
1
,
minHeight
:
'
100%
'
}}
>
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flex
:
1
,
minHeight
:
'
100%
'
}}
>
<
DocumentTitle
title
=
{
messages
.
title
||
'
Moe Cube
'
}
/
>
<
Header
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
}}
>
...
...
src/routes/Login.js
View file @
65c02fb0
...
...
@@ -35,7 +35,7 @@ class Login extends React.Component {
const
{
intl
:
{
messages
}
}
=
this
.
context
;
return
(
<
div
style
=
{{
display
:
'
flex
'
,
flex
Grow
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
height
:
'
100%
'
}}
>
<
div
style
=
{{
display
:
'
flex
'
,
flex
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
height
:
'
100%
'
}}
>
<
Spin
spinning
=
{
loading
}
delay
=
{
100
}
>
<
Form
onSubmit
=
{
this
.
onSubmitLogin
}
className
=
"
login-form
"
>
...
...
src/routes/Profiles.js
View file @
65c02fb0
...
...
@@ -101,44 +101,32 @@ class Profiles extends React.Component {
<
Form
onSubmit
=
{
this
.
onUpdateSubmit
}
>
<
FormItem
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
{
isUpload
?
<
div
>
<
Cropper
ref
=
{(
cropper
)
=>
{
this
.
cropper
=
cropper
;
}}
src
=
{
imageUrl
||
defaultAvatar
}
style
=
{{
height
:
'
20vw
'
,
width
:
'
20vw
'
}}
aspectRatio
=
{
1
/
1
}
guides
/>
<
Button
>
<
label
>
<
Icon
type
=
"
plus
"
/>
add
file
<
input
type
=
"
file
"
onChange
=
{
this
.
onGetFile
}
ref
=
{(
file
)
=>
{
this
.
file
=
file
;
}}
style
=
{{
display
:
'
none
'
}}
/
>
<
/label
>
<
/Button
>
<
Button
type
=
"
primary
"
onClick
=
{
this
.
handleUpload
}
>
<
Icon
type
=
"
upload
"
/>
upload
<
/Button
>
<
/div
>
:
<
img
alt
=
"
avatar
"
src
=
{
avatar
||
imageUrl
||
defaultAvatar
}
style
=
{{
height
:
'
256px
'
,
width
:
'
256px
'
}}
onClick
=
{()
=>
dispatch
({
type
:
'
upload/start
'
})}
/
>
}
<
div
style
=
{{
display
:
isUpload
?
'
flex
'
:
'
none
'
,
flexDirection
:
'
column
'
}}
>
<
Cropper
ref
=
{
cropper
=>
{
this
.
cropper
=
cropper
;
}}
src
=
{
imageUrl
||
defaultAvatar
}
style
=
{{
height
:
'
20vw
'
,
width
:
'
20vw
'
}}
aspectRatio
=
{
1
/
1
}
guides
=
{
true
}
/
>
<
Button
type
=
"
primary
"
onClick
=
{
this
.
handleUpload
}
>
<
Icon
type
=
"
upload
"
/>
upload
<
/Button
>
<
/div
>
<
div
style
=
{{
display
:
!
isUpload
?
'
flex
'
:
'
none
'
,
flexDirection
:
'
column
'
}}
>
<
img
src
=
{
avatar
||
imageUrl
||
defaultAvatar
}
/
>
<
Button
onClick
=
{()
=>
{
dispatch
({
type
:
'
upload/start
'
})
}}
>
<
label
>
<
Icon
type
=
"
plus
"
/>
Change
Avatar
<
input
type
=
"
file
"
onChange
=
{
this
.
onGetFile
}
ref
=
{
file
=>
{
this
.
file
=
file
;
}}
style
=
{{
display
:
'
none
'
}}
/
>
<
/label
>
<
/Button
>
<
/div
>
<
/FormItem
>
<
FormItem
{...
nameProps
.
fromItem
}
>
...
...
src/routes/Register.js
View file @
65c02fb0
...
...
@@ -60,22 +60,23 @@ class Register extends React.Component {
const
emailProps
=
{
hasFeedback
:
true
,
validateStatus
:
checkEmail
,
help
:
isEmailExists
?
messages
.
i_email_exists
:
''
,
extra
:
isEmailExists
?
messages
[
'
i_email_exists
'
]
:
''
,
};
const
emailInputProps
=
{
onBlur
:
()
=>
dispatch
({
type
:
'
auth/checkEmail
'
,
payload
:
{
...
form
.
getFieldsValue
()
}
}),
onBlur
:
()
=>
!
form
.
getFieldError
(
"
email
"
)
&&
dispatch
({
type
:
'
auth/checkEmail
'
,
payload
:
{
...
form
.
getFieldsValue
()
}
}),
placeholder
:
messages
.
email
,
};
const
usernameProps
=
{
hasFeedback
:
true
,
validateStatus
:
checkUsername
,
help
:
isUserNameExists
?
'
username exists
'
:
''
,
extra
:
isUserNameExists
?
'
username exists
'
:
''
,
};
const
usernameInputProps
=
{
onBlur
:
()
=>
dispatch
({
type
:
'
auth/checkUsername
'
,
payload
:
{
...
form
.
getFieldsValue
()
}
}),
onBlur
:
()
=>
!
form
.
getFieldError
(
"
username
"
)
&&
dispatch
({
type
:
'
auth/checkUsername
'
,
payload
:
{
...
form
.
getFieldsValue
()
}
}),
placeholder
:
messages
.
username
,
};
...
...
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