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
e89dadee
Commit
e89dadee
authored
Jul 11, 2018
by
愚道
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish login and register page
parent
da4bd116
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
46 deletions
+43
-46
config/config.js
config/config.js
+13
-2
src/pages/User/Register.js
src/pages/User/Register.js
+1
-1
src/pages/User/_layout.js
src/pages/User/_layout.js
+0
-15
src/pages/layouts/UserLayout.js
src/pages/layouts/UserLayout.js
+29
-28
No files found.
config/config.js
View file @
e89dadee
...
@@ -24,6 +24,19 @@ export default {
...
@@ -24,6 +24,19 @@ export default {
// 路由配置
// 路由配置
routes
:
[
routes
:
[
// user
{
path
:
'
/user
'
,
component
:
'
./layouts/UserLayout
'
,
routes
:
[
{
path
:
'
/user
'
,
redirect
:
'
/user/login
'
},
{
path
:
'
/user/login
'
,
component
:
'
/User/Login
'
},
{
path
:
'
/user/register
'
,
component
:
'
./User/Register
'
},
{
path
:
'
/user/register-result
'
,
component
:
'
./User/RegisterResult
'
},
],
},
// app
{
{
path
:
'
/
'
,
path
:
'
/
'
,
component
:
'
./layouts/LoadingPage
'
,
component
:
'
./layouts/LoadingPage
'
,
...
@@ -102,8 +115,6 @@ export default {
...
@@ -102,8 +115,6 @@ export default {
},
},
],
],
},
},
// user
],
],
},
},
],
],
...
...
src/pages/User/Register.js
View file @
e89dadee
...
@@ -40,7 +40,7 @@ export default class Register extends Component {
...
@@ -40,7 +40,7 @@ export default class Register extends Component {
if
(
register
.
status
===
'
ok
'
)
{
if
(
register
.
status
===
'
ok
'
)
{
dispatch
(
dispatch
(
routerRedux
.
push
({
routerRedux
.
push
({
pathname
:
'
/
User/RegisterR
esult
'
,
pathname
:
'
/
user/register-r
esult
'
,
state
:
{
state
:
{
account
,
account
,
},
},
...
...
src/pages/User/_layout.js
deleted
100644 → 0
View file @
da4bd116
import
React
from
'
react
'
;
import
{
getRouterData
}
from
'
common/router
'
;
import
{
getMenuData
}
from
'
common/menu
'
;
import
UserLayout
from
'
../layouts/UserLayout
'
;
export
default
props
=>
{
const
{
children
,
location
}
=
props
;
const
routerData
=
getRouterData
({});
const
menuData
=
getMenuData
({});
return
(
<
UserLayout
routerData
=
{
routerData
}
menuData
=
{
menuData
}
location
=
{
location
}
{...
props
}
>
{
children
}
<
/UserLayout
>
);
};
src/pages/layouts/UserLayout.js
View file @
e89dadee
import
React
,
{
Fragment
}
from
'
react
'
;
import
React
,
{
Fragment
}
from
'
react
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Link
}
from
'
dva/router
'
;
import
DocumentTitle
from
'
react-document-title
'
;
//
import DocumentTitle from 'react-document-title';
import
{
Icon
}
from
'
antd
'
;
import
{
Icon
}
from
'
antd
'
;
import
GlobalFooter
from
'
../components/GlobalFooter
'
;
import
GlobalFooter
from
'
../
../
components/GlobalFooter
'
;
import
styles
from
'
./UserLayout.less
'
;
import
styles
from
'
./UserLayout.less
'
;
import
logo
from
'
../assets/logo.svg
'
;
import
logo
from
'
../
../
assets/logo.svg
'
;
// TODO:remove
// TODO:remove
// import { getRoutes, getPageQuery, getQueryPath } from '../utils/utils';
// import { getRoutes, getPageQuery, getQueryPath } from '../utils/utils';
...
@@ -42,20 +42,21 @@ const copyright = (
...
@@ -42,20 +42,21 @@ const copyright = (
// }
// }
class
UserLayout
extends
React
.
PureComponent
{
class
UserLayout
extends
React
.
PureComponent
{
getPageTitle
()
{
// TODO title
const
{
routerData
,
location
}
=
this
.
props
;
// getPageTitle() {
const
{
pathname
}
=
location
;
// const { routerData, location } = this.props;
let
title
=
'
Ant Design Pro
'
;
// const { pathname } = location;
if
(
routerData
[
pathname
]
&&
routerData
[
pathname
].
name
)
{
// let title = 'Ant Design Pro';
title
=
`
${
routerData
[
pathname
].
name
}
- Ant Design Pro`
;
// if (routerData[pathname] && routerData[pathname].name) {
}
// title = `${routerData[pathname].name} - Ant Design Pro`;
return
title
;
// }
}
// return title;
// }
render
()
{
render
()
{
const
{
children
}
=
this
.
props
;
const
{
children
}
=
this
.
props
;
return
(
return
(
<
DocumentTitle
title
=
{
this
.
getPageTitle
()}
>
// TODO
<DocumentTitle title={this.getPageTitle()}>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
top
}
>
<
div
className
=
{
styles
.
top
}
>
...
@@ -82,7 +83,7 @@ class UserLayout extends React.PureComponent {
...
@@ -82,7 +83,7 @@ class UserLayout extends React.PureComponent {
<
/div
>
<
/div
>
<
GlobalFooter
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
GlobalFooter
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
/div
>
<
/div
>
<
/DocumentTitle
>
//
</DocumentTitle>
);
);
}
}
}
}
...
...
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