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
f6c98b2e
Commit
f6c98b2e
authored
Apr 06, 2017
by
2breakegg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reformat code
parent
e32291a9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
36 deletions
+25
-36
src/components/EmailForm.js
src/components/EmailForm.js
+1
-1
src/components/SendEmail.js
src/components/SendEmail.js
+1
-1
src/models/auth.js
src/models/auth.js
+0
-1
src/models/common.js
src/models/common.js
+1
-1
src/models/user.js
src/models/user.js
+13
-13
src/routes/Activate.js
src/routes/Activate.js
+0
-3
src/routes/Forgot.js
src/routes/Forgot.js
+1
-1
src/routes/Index.js
src/routes/Index.js
+1
-1
src/routes/Profiles.js
src/routes/Profiles.js
+7
-14
No files found.
src/components/EmailForm.js
View file @
f6c98b2e
...
...
@@ -99,7 +99,7 @@ class EmailForm extends React.Component {
}
function
mapStateToProps
(
state
,
props
)
{
function
mapStateToProps
(
state
)
{
const
{
user
:
{
user
},
auth
:
{
isEmailExists
,
checkEmail
},
...
...
src/components/SendEmail.js
View file @
f6c98b2e
...
...
@@ -72,7 +72,7 @@ class EmailForm extends React.Component {
}
function
mapStateToProps
(
state
,
props
)
{
function
mapStateToProps
(
state
)
{
const
{
user
:
{
user
},
auth
:
{
isEmailExists
,
checkEmail
,
isSendEmailActive
},
...
...
src/models/auth.js
View file @
f6c98b2e
...
...
@@ -166,7 +166,6 @@ export default {
}
},
*
checkEmail
({
payload
},
{
call
,
put
})
{
if
(
!
payload
.
email
)
{
yield
put
({
type
:
'
check
'
,
payload
:
{
checkEmail
:
'
error
'
}
});
return
;
...
...
src/models/common.js
View file @
f6c98b2e
...
...
@@ -17,7 +17,7 @@ export default {
effects
:
{},
subscriptions
:
{
setup
({
dispatch
})
{
le
t
language
=
localStorage
.
getItem
(
'
locale
'
)
||
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
cons
t
language
=
localStorage
.
getItem
(
'
locale
'
)
||
navigator
.
language
||
(
navigator
.
languages
&&
navigator
.
languages
[
0
])
||
navigator
.
userLanguage
;
const
languageWithoutRegionCode
=
language
.
toLowerCase
().
split
(
/
[
_-
]
+/
)[
0
];
const
messages
=
i18n
[
languageWithoutRegionCode
];
...
...
src/models/user.js
View file @
f6c98b2e
...
...
@@ -118,7 +118,7 @@ export default {
const
{
token
}
=
payload
;
try
{
le
t
{
data
}
=
yield
call
(
getAuthUser
,
{
token
});
cons
t
{
data
}
=
yield
call
(
getAuthUser
,
{
token
});
if
(
data
)
{
yield
put
({
type
:
'
getAuthUserSuccess
'
,
payload
:
{
user
:
data
,
token
}
});
}
...
...
@@ -135,7 +135,7 @@ export default {
}
try
{
le
t
{
data
}
=
yield
call
(
getAuthUser
,
{
token
});
cons
t
{
data
}
=
yield
call
(
getAuthUser
,
{
token
});
if
(
data
)
{
if
(
handleSSO
(
data
))
{
return
;
...
...
@@ -155,10 +155,10 @@ export default {
*
updateProfile
({
payload
},
{
call
,
put
,
select
})
{
message
.
destroy
();
le
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
le
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
cons
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
cons
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
try
{
le
t
{
data
}
=
yield
call
(
updateProfile
,
{
...
payload
,
token
});
cons
t
{
data
}
=
yield
call
(
updateProfile
,
{
...
payload
,
token
});
if
(
data
)
{
yield
put
({
type
:
'
updateProfileSuccess
'
,
payload
:
{
user
:
data
,
token
}
});
...
...
@@ -170,10 +170,10 @@ export default {
}
},
*
updateEmail
({
payload
},
{
call
,
put
,
select
})
{
le
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
cons
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
try
{
le
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
le
t
{
data
}
=
yield
call
(
updateAccount
,
{
...
payload
,
token
});
cons
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
cons
t
{
data
}
=
yield
call
(
updateAccount
,
{
...
payload
,
token
});
if
(
data
)
{
yield
put
({
type
:
'
updateAccountSuccess
'
,
payload
:
{
user
:
data
,
token
}
});
message
.
info
(
messages
[
'
A-verification-email-has-been-sent-to-you,please-check-the-mail-to-complete.
'
]);
...
...
@@ -185,10 +185,10 @@ export default {
},
*
updateAccount
({
payload
},
{
call
,
put
,
select
})
{
le
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
cons
t
{
messages
}
=
yield
select
(
state
=>
state
.
common
);
try
{
le
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
le
t
{
data
}
=
yield
call
(
updateAccount
,
{
...
payload
,
token
});
cons
t
token
=
yield
select
(
state
=>
state
.
user
.
token
);
cons
t
{
data
}
=
yield
call
(
updateAccount
,
{
...
payload
,
token
});
if
(
data
)
{
yield
put
({
type
:
'
updateAccountSuccess
'
,
payload
:
{
user
:
data
,
token
}
});
message
.
info
(
messages
.
update_success
);
...
...
@@ -201,12 +201,12 @@ export default {
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
le
t
token
=
localStorage
.
getItem
(
'
token
'
);
cons
t
token
=
localStorage
.
getItem
(
'
token
'
);
if
(
token
)
{
dispatch
({
type
:
'
getAuthUser
'
,
payload
:
{
token
}
});
}
history
.
listen
(({
pathname
})
=>
{
if
(
pathname
==
'
/
'
)
{
if
(
pathname
==
=
'
/
'
)
{
dispatch
({
type
:
'
preLogin
'
,
payload
:
{
token
}
});
}
});
...
...
src/routes/Activate.js
View file @
f6c98b2e
...
...
@@ -24,10 +24,7 @@ class Active extends React.Component {
}
function
mapStateToProps
(
state
)
{
const
{}
=
state
;
const
loading
=
state
.
loading
.
global
||
false
;
return
{
loading
,
};
...
...
src/routes/Forgot.js
View file @
f6c98b2e
import
{
Button
,
Form
,
Icon
,
Input
,
S
elect
,
S
pin
,
Steps
}
from
'
antd
'
;
import
{
Button
,
Form
,
Icon
,
Input
,
Spin
,
Steps
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
Link
}
from
'
dva/router
'
;
import
React
,
{
PropTypes
}
from
'
react
'
;
...
...
src/routes/Index.js
View file @
f6c98b2e
...
...
@@ -126,7 +126,7 @@ const particleConfig = {
function
Index
({
children
,
messages
})
{
return
(
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flex
:
1
,
height
:
'
100vh
'
}}
>
<
DocumentTitle
title
=
{
messages
[
'
title
'
]
||
'
Moe Cube
'
}
/
>
<
DocumentTitle
title
=
{
messages
.
title
||
'
Moe Cube
'
}
/
>
<
Header
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
}}
>
<
Link
to
=
"
/
"
style
=
{{
marginTop
:
'
20px
'
}}
>
...
...
src/routes/Profiles.js
View file @
f6c98b2e
...
...
@@ -41,11 +41,9 @@ class Profiles extends React.Component {
console
.
log
(
blob
);
this
.
props
.
dispatch
({
type
:
'
upload/upload
'
,
payload
:
{
image
:
blob
,
user_id
:
id
}
});
});
};
onGetFile
=
(
e
)
=>
{
let
files
;
if
(
e
.
dataTransfer
)
{
files
=
e
.
dataTransfer
.
files
;
...
...
@@ -75,9 +73,9 @@ class Profiles extends React.Component {
};
render
()
{
const
{
dispatch
,
form
,
user
,
loading
,
progress
,
status
,
imageUrl
,
isUpload
,
uploadedImage
}
=
this
.
props
;
const
{
dispatch
,
form
,
user
,
loading
,
imageUrl
,
isUpload
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
{
username
,
name
,
id
,
avatar
}
=
user
;
const
{
name
,
avatar
}
=
user
;
const
{
intl
:
{
messages
}
}
=
this
.
context
;
const
nameProps
=
{
...
...
@@ -93,12 +91,6 @@ class Profiles extends React.Component {
},
};
const
crop
=
{
maxHeight
:
80
,
width
:
30
,
aspect
:
16
/
16
,
};
return
(
<
Spin
spinning
=
{
loading
}
delay
=
{
100
}
>
...
...
@@ -127,19 +119,20 @@ class Profiles extends React.Component {
}}
style
=
{{
display
:
'
none
'
}}
/
>
<
/label
>
<
/Button
>
<
Button
type
=
"
primary
"
onClick
=
{
this
.
handleUpload
}
>
<
Button
type
=
"
primary
"
onClick
=
{
this
.
handleUpload
}
>
<
Icon
type
=
"
upload
"
/>
upload
<
/Button
>
<
/div
>
:
<
img
src
=
{
avatar
||
imageUrl
||
defaultAvatar
}
onClick
=
{()
=>
dispatch
({
type
:
'
upload/start
'
})}
/
>
<
img
src
=
{
avatar
||
imageUrl
||
defaultAvatar
}
onClick
=
{()
=>
dispatch
({
type
:
'
upload/start
'
})}
/
>
}
<
/FormItem
>
<
FormItem
{...
nameProps
.
fromItem
}
>
{
getFieldDecorator
(
`name`
,
{
...
nameProps
.
decorator
})(
{
getFieldDecorator
(
'
name
'
,
{
...
nameProps
.
decorator
})(
<
Input
{...
nameProps
.
input
}
/>
,
)}
<
/FormItem
>
...
...
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