Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
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
duanledexianxianxian
ant-design-pro
Commits
da4bd116
Commit
da4bd116
authored
Jul 11, 2018
by
愚道
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add account settings
parent
931e27fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
41 deletions
+24
-41
config/config.js
config/config.js
+15
-13
src/common/menu.js
src/common/menu.js
+1
-1
src/pages/Account/Settings/BaseView.js
src/pages/Account/Settings/BaseView.js
+4
-0
src/pages/layouts/BlankLayout.js
src/pages/layouts/BlankLayout.js
+0
-3
src/pages/layouts/LoadingPage.js
src/pages/layouts/LoadingPage.js
+4
-1
src/pages/layouts/index.js
src/pages/layouts/index.js
+0
-23
No files found.
config/config.js
View file @
da4bd116
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
routes
:
[
routes
:
[
{
{
path
:
'
/
'
,
path
:
'
/
'
,
component
:
'
./layouts/
index
'
,
component
:
'
./layouts/
LoadingPage
'
,
routes
:
[
routes
:
[
// dashboard
// dashboard
{
path
:
'
/
'
,
redirect
:
'
/dashboard/analysis
'
},
{
path
:
'
/
'
,
redirect
:
'
/dashboard/analysis
'
},
...
@@ -77,31 +77,33 @@ export default {
...
@@ -77,31 +77,33 @@ export default {
{
path
:
'
/exception/404
'
,
component
:
'
./Exception/404
'
},
{
path
:
'
/exception/404
'
,
component
:
'
./Exception/404
'
},
{
path
:
'
/exception/500
'
,
component
:
'
./Exception/500
'
},
{
path
:
'
/exception/500
'
,
component
:
'
./Exception/500
'
},
// acount
// ac
c
ount
{
{
path
:
'
/acount/center
'
,
path
:
'
/ac
c
ount/center
'
,
component
:
'
./Account/Center/Center
'
,
component
:
'
./Account/Center/Center
'
,
routes
:
[
routes
:
[
{
path
:
'
/ac
ount/center
'
,
redirect
:
'
/a
count/center/articles
'
},
{
path
:
'
/ac
count/center
'
,
redirect
:
'
/ac
count/center/articles
'
},
{
path
:
'
/acount/center/articles
'
,
component
:
'
./Account/Center/Articles
'
},
{
path
:
'
/ac
c
ount/center/articles
'
,
component
:
'
./Account/Center/Articles
'
},
{
path
:
'
/acount/center/applications
'
,
component
:
'
./Account/Center/Applications
'
},
{
path
:
'
/ac
c
ount/center/applications
'
,
component
:
'
./Account/Center/Applications
'
},
{
path
:
'
/acount/center/projects
'
,
component
:
'
./Account/Center/Projects
'
},
{
path
:
'
/ac
c
ount/center/projects
'
,
component
:
'
./Account/Center/Projects
'
},
],
],
},
},
{
{
path
:
'
/acount/settings
'
,
path
:
'
/ac
c
ount/settings
'
,
component
:
'
./Account/Settings/Info
'
,
component
:
'
./Account/Settings/Info
'
,
routes
:
[
routes
:
[
{
path
:
'
/ac
ount/settings
'
,
redirect
:
'
/a
count/settings/base
'
},
{
path
:
'
/ac
count/settings
'
,
redirect
:
'
/ac
count/settings/base
'
},
{
path
:
'
/ac
ount/center
/base
'
,
component
:
'
./Account/Settings/BaseView
'
},
{
path
:
'
/ac
count/settings
/base
'
,
component
:
'
./Account/Settings/BaseView
'
},
{
path
:
'
/ac
ount/center
/security
'
,
component
:
'
./Account/Settings/SecurityView
'
},
{
path
:
'
/ac
count/settings
/security
'
,
component
:
'
./Account/Settings/SecurityView
'
},
{
path
:
'
/ac
ount/center
/binding
'
,
component
:
'
./Account/Settings/BindingView
'
},
{
path
:
'
/ac
count/settings
/binding
'
,
component
:
'
./Account/Settings/BindingView
'
},
{
{
path
:
'
/ac
ount/center
/notification
'
,
path
:
'
/ac
count/settings
/notification
'
,
component
:
'
./Account/Settings/NotificationView
'
,
component
:
'
./Account/Settings/NotificationView
'
,
},
},
],
],
},
},
// user
],
],
},
},
],
],
...
...
src/common/menu.js
View file @
da4bd116
...
@@ -352,7 +352,7 @@ const menuData = [
...
@@ -352,7 +352,7 @@ const menuData = [
{
{
name
:
'
个人页
'
,
name
:
'
个人页
'
,
icon
:
'
user
'
,
icon
:
'
user
'
,
path
:
'
acount
'
,
path
:
'
ac
c
ount
'
,
children
:
[
children
:
[
{
{
name
:
'
个人中心
'
,
name
:
'
个人中心
'
,
...
...
src/pages/Account/Settings/BaseView.js
View file @
da4bd116
import
React
,
{
Component
,
Fragment
}
from
'
react
'
;
import
React
,
{
Component
,
Fragment
}
from
'
react
'
;
import
{
Form
,
Input
,
Upload
,
Select
,
Button
}
from
'
antd
'
;
import
{
Form
,
Input
,
Upload
,
Select
,
Button
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
styles
from
'
./BaseView.less
'
;
import
styles
from
'
./BaseView.less
'
;
import
GeographicView
from
'
./GeographicView
'
;
import
GeographicView
from
'
./GeographicView
'
;
import
PhoneView
from
'
./PhoneView
'
;
import
PhoneView
from
'
./PhoneView
'
;
...
@@ -44,6 +45,9 @@ const validatorPhone = (rule, value, callback) => {
...
@@ -44,6 +45,9 @@ const validatorPhone = (rule, value, callback) => {
callback
();
callback
();
};
};
@
connect
(({
user
})
=>
({
currentUser
:
user
.
currentUser
,
}))
@
Form
.
create
()
@
Form
.
create
()
export
default
class
BaseView
extends
Component
{
export
default
class
BaseView
extends
Component
{
componentDidMount
()
{
componentDidMount
()
{
...
...
src/pages/layouts/BlankLayout.js
deleted
100644 → 0
View file @
931e27fb
import
React
from
'
react
'
;
export
default
props
=>
<
div
style
=
{{
height
:
'
100%
'
}}
{...
props
}
/>
;
src/pages/layouts/LoadingPage.js
View file @
da4bd116
...
@@ -3,12 +3,14 @@ import { Spin } from 'antd';
...
@@ -3,12 +3,14 @@ import { Spin } from 'antd';
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
enquireScreen
,
unenquireScreen
}
from
'
enquire-js
'
;
import
{
enquireScreen
,
unenquireScreen
}
from
'
enquire-js
'
;
import
BasicLayout
from
'
./BasicLayout
'
;
import
BasicLayout
from
'
./BasicLayout
'
;
import
{
getMenuData
}
from
'
../common/menu
'
;
import
{
getMenuData
}
from
'
../../common/menu
'
;
import
{
getRouterData
}
from
'
../../common/router
'
;
/**
/**
* 根据菜单取得重定向地址.
* 根据菜单取得重定向地址.
*/
*/
const
MenuData
=
getMenuData
();
const
MenuData
=
getMenuData
();
const
routerData
=
getRouterData
({});
const
getRedirectData
=
()
=>
{
const
getRedirectData
=
()
=>
{
const
redirectData
=
[];
const
redirectData
=
[];
const
getRedirect
=
item
=>
{
const
getRedirect
=
item
=>
{
...
@@ -90,6 +92,7 @@ class LoadingPage extends PureComponent {
...
@@ -90,6 +92,7 @@ class LoadingPage extends PureComponent {
<
BasicLayout
<
BasicLayout
isMobile
=
{
isMobile
}
isMobile
=
{
isMobile
}
menuData
=
{
MenuData
}
menuData
=
{
MenuData
}
routerData
=
{
routerData
}
redirectData
=
{
redirectData
}
redirectData
=
{
redirectData
}
{...
this
.
props
}
{...
this
.
props
}
/
>
/
>
...
...
src/pages/layouts/index.js
deleted
100644 → 0
View file @
931e27fb
import
React
from
'
react
'
;
import
{
getRouterData
}
from
'
common/router
'
;
import
{
getMenuData
}
from
'
common/menu
'
;
import
BasecLayout
from
'
./BasicLayout
'
;
import
BlankLayout
from
'
./BlankLayout
'
;
// TODO routerData menuData etc...
const
openPages
=
[
'
/User
'
,
'
/User/Login
'
,
'
/User/Register
'
,
'
/User/RegisterResult
'
];
export
default
props
=>
{
const
{
children
,
location
}
=
props
;
const
routerData
=
getRouterData
({});
const
menuData
=
getMenuData
({});
let
{
pathname
}
=
location
;
pathname
=
pathname
.
startsWith
(
'
/
'
)
?
pathname
:
`/
${
pathname
}
`
;
if
(
openPages
&&
openPages
.
includes
(
pathname
))
{
return
<
BlankLayout
>
{
children
}
<
/BlankLayout>
;
}
return
(
<
BasecLayout
routerData
=
{
routerData
}
menuData
=
{
menuData
}
location
=
{
location
}
>
{
children
}
<
/BasecLayout
>
);
};
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