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
P
pro-blocks
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
pro-blocks
Commits
b1ef8d42
Commit
b1ef8d42
authored
Jul 12, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: Fix trigger page
parent
ac4dfc12
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
40 deletions
+22
-40
config/config.js
config/config.js
+1
-1
src/components/GlobalHeader/RightContent.js
src/components/GlobalHeader/RightContent.js
+1
-1
src/models/login.js
src/models/login.js
+2
-0
src/pages/404.js
src/pages/404.js
+7
-0
src/pages/layouts/BasicLayout.js
src/pages/layouts/BasicLayout.js
+5
-27
src/utils/request.js
src/utils/request.js
+6
-11
No files found.
config/config.js
View file @
b1ef8d42
...
...
@@ -95,7 +95,7 @@ export default {
{
path
:
'
/exception/403
'
,
component
:
'
./Exception/403
'
},
{
path
:
'
/exception/404
'
,
component
:
'
./Exception/404
'
},
{
path
:
'
/exception/500
'
,
component
:
'
./Exception/500
'
},
{
path
:
'
/exception/trigger
'
,
component
:
'
./Exception/triggerException
'
},
// account
{
path
:
'
/account/center
'
,
...
...
src/components/GlobalHeader/RightContent.js
View file @
b1ef8d42
...
...
@@ -18,7 +18,6 @@ export default class GlobalHeaderRight extends PureComponent {
if
(
newNotice
.
datetime
)
{
newNotice
.
datetime
=
moment
(
notice
.
datetime
).
fromNow
();
}
// transform id to item key
if
(
newNotice
.
id
)
{
newNotice
.
key
=
newNotice
.
id
;
}
...
...
@@ -154,6 +153,7 @@ export default class GlobalHeaderRight extends PureComponent {
)}
<
Button
size
=
"
small
"
ghost
=
{
theme
===
'
dark
'
}
onClick
=
{()
=>
{
this
.
changLang
();
}}
...
...
src/models/login.js
View file @
b1ef8d42
...
...
@@ -40,9 +40,11 @@ export default {
yield
put
(
routerRedux
.
replace
(
redirect
||
'
/
'
));
}
},
*
getCaptcha
({
payload
},
{
call
})
{
yield
call
(
getFakeCaptcha
,
payload
);
},
*
logout
(
_
,
{
put
})
{
yield
put
({
type
:
'
changeLoginStatus
'
,
...
...
src/pages/404.js
0 → 100644
View file @
b1ef8d42
import
React
from
'
react
'
;
import
{
Link
}
from
'
dva/router
'
;
import
Exception
from
'
components/Exception
'
;
export
default
()
=>
(
<
Exception
type
=
"
404
"
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
linkElement
=
{
Link
}
/
>
);
src/pages/layouts/BasicLayout.js
View file @
b1ef8d42
...
...
@@ -29,6 +29,7 @@ const { check } = Authorized;
* @param {Object} routerData 路由配置
*/
const
getBreadcrumbNameMap
=
memoizeOne
((
meun
,
router
)
=>
{
console
.
log
(
meun
,
router
);
const
routerMap
=
{};
const
mergeMeunAndRouter
=
meunData
=>
{
meunData
.
forEach
(
meunItem
=>
{
...
...
@@ -71,6 +72,7 @@ class BasicLayout extends React.PureComponent {
constructor
(
props
)
{
super
(
props
);
const
{
routerData
,
menuData
}
=
this
.
props
;
this
.
getPageTitle
=
memoizeOne
(
this
.
getPageTitle
);
this
.
breadcrumbNameMap
=
getBreadcrumbNameMap
(
menuData
,
routerData
);
}
...
...
@@ -148,19 +150,14 @@ class BasicLayout extends React.PureComponent {
};
render
()
{
// TODO remove old router code
const
{
isMobile
,
// redirectData,
// routerData,
silderTheme
,
layout
:
PropsLayout
,
children
,
location
:
{
pathname
},
}
=
this
.
props
;
const
isTop
=
PropsLayout
===
'
topmenu
'
;
// const bashRedirect = this.getBashRedirect();
// const myRedirectData = redirectData || [];
const
layout
=
(
<
Layout
>
{
isTop
&&
!
isMobile
?
null
:
(
...
...
@@ -174,33 +171,14 @@ class BasicLayout extends React.PureComponent {
)}
<
Layout
style
=
{
this
.
getLayoutStyle
()}
>
<
Header
handleMenuCollapse
=
{
this
.
handleMenuCollapse
}
logo
=
{
logo
}
{...
this
.
props
}
/
>
<
Content
style
=
{
this
.
getContentStyle
()}
>
{
children
}
{
/* <Switch> TODO remove
{myRedirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
<Redirect exact from="/" to={bashRedirect} />
<Route render={NotFound} />
</Switch> */
}
<
/Content
>
<
Content
style
=
{
this
.
getContentStyle
()}
>
{
children
}
<
/Content
>
<
Footer
/>
<
/Layout
>
<
/Layout
>
);
const
getPageTitle
=
memoizeOne
(
this
.
getPageTitle
);
return
(
<
DocumentTitle
title
=
{
getPageTitle
(
pathname
)}
>
<
DocumentTitle
title
=
{
this
.
getPageTitle
(
pathname
)}
>
<
ContainerQuery
query
=
{
query
}
>
{
params
=>
(
<
Context
.
Provider
value
=
{
this
.
getContext
()}
>
...
...
src/utils/request.js
View file @
b1ef8d42
import
fetch
from
'
dva/fetch
'
;
import
{
notification
}
from
'
antd
'
;
import
{
routerRedux
}
from
'
dva/router
'
;
// TODO set store
// import store from '../global';
// use global store
const
store
=
window
.
g_app
.
_store
import
router
from
'
umi/router
'
;
const
codeMessage
=
{
200
:
'
服务器成功返回请求的数据。
'
,
...
...
@@ -81,24 +76,24 @@ export default function request(url, options) {
return
response
.
json
();
})
.
catch
(
e
=>
{
const
{
dispatch
}
=
store
;
const
status
=
e
.
name
;
if
(
status
===
401
)
{
dispatch
({
/* eslint-disable no-underscore-dangle */
window
.
g_app
.
_store
.
dispatch
({
type
:
'
login/logout
'
,
});
return
;
}
if
(
status
===
403
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/403
'
)
);
router
.
push
(
'
/exception/403
'
);
return
;
}
if
(
status
<=
504
&&
status
>=
500
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/500
'
)
);
router
.
push
(
'
/exception/500
'
);
return
;
}
if
(
status
>=
404
&&
status
<
422
)
{
dispatch
(
routerRedux
.
push
(
'
/exception/404
'
)
);
router
.
push
(
'
/exception/404
'
);
}
});
}
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