diff --git a/src/App.js b/src/App.js index 59e60d5b5..1e576f5e2 100644 --- a/src/App.js +++ b/src/App.js @@ -21,7 +21,7 @@ class App extends Component { // fetchData({funcName: 'admin', stateName: 'auth'}); this.getClientWidth(); window.onresize = () => { - console.log('屏幕变化了'); + // console.log('屏幕变化了'); this.getClientWidth(); // console.log(document.body.clientWidth); } @@ -51,7 +51,7 @@ class App extends Component { getClientWidth = () => { // 获取当前浏览器宽度并设置responsive管理响应式 const { receiveData } = this.props; const clientWidth = document.body.clientWidth; - console.log(clientWidth); + // console.log(clientWidth); receiveData({isMobile: clientWidth <= 992}, 'responsive'); }; toggle = () => { @@ -60,7 +60,7 @@ class App extends Component { }); }; render() { - // console.log(this.props.auth); + console.log(this.props.auth); // console.log(this.props.responsive); const { auth, responsive } = this.props; return ( diff --git a/src/routes/index.js b/src/routes/index.js index cd8b0a2b3..41b1c1895 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -16,7 +16,8 @@ export default class CRouter extends Component { }; requireLogin = (component, permission) => { const { auth } = this.props; - const { permissions } = auth.data; + const { permissions } = auth.data || {}; + // console.log(permissions); if (process.env.NODE_ENV === 'production' && !permissions) { // 线上环境判断是否登录 return ; }