|
|
@@ -28,8 +28,8 @@ class NavigationGuards extends Component<NavigationGuardsProps, any> {
|
|
|
* 根据路由改变动态改变标签页title
|
|
|
*/
|
|
|
changDocumentTitle = (path: string) => {
|
|
|
-
|
|
|
const pathTitle = frameStore.routeNameMapping.get(path) as string
|
|
|
+
|
|
|
if (!pathTitle) {
|
|
|
document.title = consts.NAME
|
|
|
}
|
|
|
@@ -47,10 +47,17 @@ class NavigationGuards extends Component<NavigationGuardsProps, any> {
|
|
|
return !!authArray.find((item) => item === myPermis)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ componentDidUpdate() {
|
|
|
+ // 防止某些页面只走update,更新标签名
|
|
|
+ this.changDocumentTitle(this.props.location.pathname)
|
|
|
+
|
|
|
+ }
|
|
|
componentDidMount() {
|
|
|
this.changDocumentTitle(this.props.location.pathname)
|
|
|
}
|
|
|
shouldComponentUpdate(nextProps: any) {
|
|
|
+
|
|
|
//与上次请求的路径相同时不重新渲染
|
|
|
if (this.props.location.pathname === nextProps.location.pathname) return false
|
|
|
return true
|