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
61521e23
Commit
61521e23
authored
Apr 07, 2017
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
env
parent
40318e4c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
300 additions
and
242 deletions
+300
-242
.gitignore
.gitignore
+2
-1
.idea/watcherTasks.xml
.idea/watcherTasks.xml
+4
-0
.idea/workspace.xml
.idea/workspace.xml
+239
-197
.travis.yml
.travis.yml
+1
-1
src/components/UserPanel.js
src/components/UserPanel.js
+23
-17
src/routes/Index.js
src/routes/Index.js
+31
-26
No files found.
.gitignore
View file @
61521e23
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
# misc
# misc
.DS_Store
.DS_Store
*
.log*
npm-debug
.log*
/utils/config.js
/utils/config.js
.idea/workspace.xml
.idea/watcherTasks.xml
0 → 100644
View file @
61521e23
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectTasksOptions"
suppressed-tasks=
"Less"
/>
</project>
\ No newline at end of file
.idea/workspace.xml
View file @
61521e23
This diff is collapsed.
Click to expand it.
.travis.yml
View file @
61521e23
language
:
node_js
language
:
node_js
node_js
:
node
node_js
:
node
env
:
env
:
NODE_
ENV
:
development
ENV
:
development
global
:
global
:
secure
:
NObcZ6fY1VQuoDfxRxKVOZ+p7g3LTDkonG4Ow4HIbx2g8wJ24mMqs9gN0J3Asbdbz68isDMpkKy7IW1mK9+N9fM0pBauqD1YMbglnEv+HhYjhiEsQdRdDM2nzDIjS4PCwavI1Da5TLhaUjSAM4lrHx7bVOK4YsvF3s8JEApS54QgSlbeJgvSbPcCiapl0VwwaL36cGndChc3tawq4xseuk4bP2NrTEd7ifYZMt+iojId+UuhRQk4w0HUlBhEDKiT/fLxeQDwMRv2WIdIPW7D7+Wo01iX+T0Ti629QhQBe/S76affkG6G085HIPin3VvXDQaiYbK4ALbc79O+9jqSxEFd9nwG8xbp2jezzvclUSXPhIyZe7VSRS6z1MdevlyQa56AUEP7My7IMqj8j7NPoUgrnVlKtR8WPHQacfAVkrcOIX+Tzwl2IMOCqonamDtJjUNX5xpYB+IEj+INvQmRqT2NicExGWj9LZp3L3kscwq1u+0hPzgoQ9yovE+OvLFNE/R5AE90GIaSlwXw4MqOeB+8l+ou2JzNZFJhHBvAsOFwQTloFz/pu7ichJ+P0KsMPteLFA4Btuo6bBu31K7R310CmlIdYJIeeybMuM6e6bG8IkbVcMq5skg9LNa64KuDG46oopwGLiWkdRwDzG3VmXGwVm+OF2EWZi/B0wIcTwY=
secure
:
NObcZ6fY1VQuoDfxRxKVOZ+p7g3LTDkonG4Ow4HIbx2g8wJ24mMqs9gN0J3Asbdbz68isDMpkKy7IW1mK9+N9fM0pBauqD1YMbglnEv+HhYjhiEsQdRdDM2nzDIjS4PCwavI1Da5TLhaUjSAM4lrHx7bVOK4YsvF3s8JEApS54QgSlbeJgvSbPcCiapl0VwwaL36cGndChc3tawq4xseuk4bP2NrTEd7ifYZMt+iojId+UuhRQk4w0HUlBhEDKiT/fLxeQDwMRv2WIdIPW7D7+Wo01iX+T0Ti629QhQBe/S76affkG6G085HIPin3VvXDQaiYbK4ALbc79O+9jqSxEFd9nwG8xbp2jezzvclUSXPhIyZe7VSRS6z1MdevlyQa56AUEP7My7IMqj8j7NPoUgrnVlKtR8WPHQacfAVkrcOIX+Tzwl2IMOCqonamDtJjUNX5xpYB+IEj+INvQmRqT2NicExGWj9LZp3L3kscwq1u+0hPzgoQ9yovE+OvLFNE/R5AE90GIaSlwXw4MqOeB+8l+ou2JzNZFJhHBvAsOFwQTloFz/pu7ichJ+P0KsMPteLFA4Btuo6bBu31K7R310CmlIdYJIeeybMuM6e6bG8IkbVcMq5skg9LNa64KuDG46oopwGLiWkdRwDzG3VmXGwVm+OF2EWZi/B0wIcTwY=
...
...
src/components/UserPanel.js
View file @
61521e23
import
React
from
'
react
'
;
import
{
Dropdown
,
Menu
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
styles
from
'
./UserPanel.css
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Dropdown
,
Menu
,
Icon
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
{
Link
}
from
'
dva/router
'
const
defaultAvatar
=
require
(
'
../../public/default_avatar.jpg
'
);
const
defaultAvatar
=
require
(
'
../../public/default_avatar.jpg
'
);
function
UserPanel
({
dispatch
,
user
,
token
})
{
function
UserPanel
({
dispatch
,
user
,
token
})
{
const
{
avatar
}
=
user
;
const
{
avatar
}
=
user
;
const
menu
=
(
const
menu
=
(
<
Menu
trigger
=
{[
'
click
'
]}
>
<
Menu
trigger
=
{[
'
click
'
]}
>
<
Menu
.
Item
>
<
Menu
.
Item
>
{
{
token
?
<
Link
to
=
"
/profiles
"
>
//i18n 个人中心</Link> : <Link to="/signin">//i18n 登录</Link>
// i18n
}
token
?
<
Link
to
=
"
/profiles
"
>
个人中心
<
/Link> : <Link to="/
signin
"
>登录</Link>
}
</Menu.Item>
</Menu.Item>
<Menu.Divider/>
<Menu.Divider/>
{
{
token
&&
token &&
<
Menu
.
Item
>
<Menu.Item >
<
div
onClick
=
{()
=>
{
dispatch
({
type
:
'
auth/signOut
'
})
}}
>
<div
<
Format
id
=
"
sign-out
"
/>
onClick={() => {
<
/div
>
dispatch({ type: 'auth/signOut' });
<
/Menu.Item
>
}}
>
<Format id=
"
sign
-
out
"
/>
</div>
</Menu.Item>
}
}
</Menu>
</Menu>
)
)
;
return (
return (
<Dropdown overlay={menu} placement=
"
bottomCenter
"
>
<Dropdown overlay={menu} placement=
"
bottomCenter
"
>
<
div
className
=
"
ant-dropdown-link
"
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
}}
>
<div className=
"
ant
-
dropdown
-
link
"
style={{ display: 'flex', alignItems: 'center' }}>
<
img
alt
=
"
avatar
"
src
=
{
avatar
||
defaultAvatar
}
style
=
{{
borderRadius
:
'
40px
'
,
height
:
'
40px
'
,
weight
:
'
auto
'
}}
/
>
<img
alt=
"
avatar
"
src={avatar || defaultAvatar}
style={{ borderRadius: '40px', height: '40px', weight: 'auto' }}
/>
</div>
</div>
</Dropdown>
</Dropdown>
);
);
...
...
src/routes/Index.js
View file @
61521e23
...
@@ -6,12 +6,12 @@ import DocumentTitle from 'react-document-title';
...
@@ -6,12 +6,12 @@ import DocumentTitle from 'react-document-title';
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
{
FormattedMessage
as
Format
}
from
'
react-intl
'
;
import
Particles
from
'
react-particles-js
'
;
import
Particles
from
'
react-particles-js
'
;
import
logo
from
'
../assets/MoeCube.png
'
;
import
logo
from
'
../assets/MoeCube.png
'
;
import
UserPanel
from
'
../components/UserPanel
'
import
UserPanel
from
'
../components/UserPanel
'
;
const
languageMap
=
{
const
languageMap
=
{
'
zh-CN
'
:
'
中文
'
,
'
zh-CN
'
:
'
中文
'
,
'
en-US
'
:
'
English
'
,
'
en-US
'
:
'
English
'
,
}
}
;
const
{
Header
,
Footer
}
=
Layout
;
const
{
Header
,
Footer
}
=
Layout
;
const
particleConfig
=
{
const
particleConfig
=
{
...
@@ -128,48 +128,53 @@ const particleConfig = {
...
@@ -128,48 +128,53 @@ const particleConfig = {
retina_detect
:
true
,
retina_detect
:
true
,
};
};
function
Index
({
children
,
messages
,
dispatch
,
client
,
token
,
language
})
{
function
Index
({
children
,
messages
,
dispatch
,
client
,
language
})
{
const
menu
=
(
const
menu
=
(
<
Menu
style
=
{{
transform
:
'
translateX(-16px)
'
}}
>
<
Menu
style
=
{{
transform
:
'
translateX(-16px)
'
}}
>
{
{
Object
.
keys
(
languageMap
).
map
((
lan
,
i
)
=>
{
Object
.
keys
(
languageMap
).
map
((
lan
,
i
)
=>
{
return
(
return
(
<
Menu
.
Item
key
=
{
i
}
>
<
Menu
.
Item
key
=
{
i
}
>
<
a
onClick
=
{()
=>
{
dispatch
({
type
:
'
common/changeLanguage
'
,
payload
:
{
language
:
lan
}
})
}}
>
<
a
onClick
=
{()
=>
{
dispatch
({
type
:
'
common/changeLanguage
'
,
payload
:
{
language
:
lan
}
});
}}
>
{
languageMap
[
lan
]}
{
languageMap
[
lan
]}
<
/a
>
<
/a
>
<
/Menu.Item
>
<
/Menu.Item
>
)
)
;
})
})
}
}
<
/Menu
>
<
/Menu
>
);
);
return
(
return
(
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flex
:
1
,
minHeight
:
'
100%
'
}}
>
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flex
:
1
,
minHeight
:
'
100%
'
}}
>
<
DocumentTitle
title
=
{
messages
.
title
||
'
Moe Cube
'
}
/
>
<
DocumentTitle
title
=
{
messages
.
title
||
'
Moe Cube
'
}
/
>
{
client
!==
'
electron
'
&&
{
client
!==
'
electron
'
&&
<
Header
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
}}
>
<
Header
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
}}
>
<
Link
to
=
"
/
"
style
=
{{
marginTop
:
'
20px
'
}}
>
<
Link
to
=
"
/
"
style
=
{{
marginTop
:
'
20px
'
}}
>
<
img
alt
=
"
logo
"
src
=
{
logo
}
style
=
{{
width
:
'
140px
'
,
height
:
'
44px
'
}}
/
>
<
img
alt
=
"
logo
"
src
=
{
logo
}
style
=
{{
width
:
'
140px
'
,
height
:
'
44px
'
}}
/
>
<
/Link
>
<
/Link
>
<
Menu
<
Menu
theme
=
"
dark
"
theme
=
"
dark
"
mode
=
"
horizontal
"
mode
=
"
horizontal
"
defaultSelectedKeys
=
{[
'
1
'
]}
defaultSelectedKeys
=
{[
'
1
'
]}
style
=
{{
lineHeight
:
'
64px
'
}}
>
style
=
{{
lineHeight
:
'
64px
'
}}
<
Menu
.
Item
key
=
"
1
"
>
>
<
Link
to
=
"
/
"
>
<
Menu
.
Item
key
=
"
1
"
>
<
Format
id
=
"
Home
"
/>
<
Link
to
=
"
/
"
>
<
/Link
>
<
Format
id
=
"
Home
"
/>
<
/Menu.Item
>
<
/Link
>
<
/Menu
>
<
/Menu.Item
>
<
/Menu
>
<
div
style
=
{{
position
:
'
absolute
'
,
right
:
'
40px
'
}}
>
<
div
style
=
{{
position
:
'
absolute
'
,
right
:
'
40px
'
}}
>
<
UserPanel
/>
<
UserPanel
/>
<
/div
>
<
/div
>
<
/Header
>
<
/Header
>
}
}
<
Particles
<
Particles
...
@@ -183,7 +188,7 @@ function Index({ children, messages, dispatch, client, token, language }) {
...
@@ -183,7 +188,7 @@ function Index({ children, messages, dispatch, client, token, language }) {
<
Footer
style
=
{{
width
:
'
100%
'
,
justifyContent
:
'
space-between
'
,
display
:
'
flex
'
,
zIndex
:
100
}}
>
<
Footer
style
=
{{
width
:
'
100%
'
,
justifyContent
:
'
space-between
'
,
display
:
'
flex
'
,
zIndex
:
100
}}
>
<
div
><
Dropdown
overlay
=
{
menu
}
trigger
=
{[
'
click
'
]}
>
<
div
><
Dropdown
overlay
=
{
menu
}
trigger
=
{[
'
click
'
]}
>
<
a
className
=
"
ant-dropdown-link changelanguage
"
>
<
a
className
=
"
ant-dropdown-link changelanguage
"
>
{
languageMap
[
language
]}
<
Icon
type
=
"
down
"
className
=
"
flag
"
/>
{
languageMap
[
language
]}
<
Icon
type
=
"
down
"
className
=
"
flag
"
/>
<
/a
>
<
/a
>
<
/Dropdown></
div
>
<
/Dropdown></
div
>
<
div
>
©
MoeCube
2017
all
right
reserved
.
<
/div
>
<
div
>
©
MoeCube
2017
all
right
reserved
.
<
/div
>
...
...
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