From fd77f034277856738ee772eec1be064604e2bf2c Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Wed, 26 Jul 2017 22:00:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E9=99=90=E5=88=B6=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E6=9C=80=E5=A4=A7=E6=9C=80=E5=B0=8F=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=95=B4=E7=90=86=E5=88=B0mixin.scss?= =?UTF-8?q?=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/constants/variable.js | 4 ---- client/containers/ProjectGroups/ProjectGroups.scss | 4 +++- client/styles/mixin.scss | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 client/styles/mixin.scss diff --git a/client/constants/variable.js b/client/constants/variable.js index a9265d45..10bfa95a 100644 --- a/client/constants/variable.js +++ b/client/constants/variable.js @@ -1,7 +1,3 @@ export default { PAGE_LIMIT: 10, // 默认每页展示10条数据 - - // layout - ROW_MIN_WIDTH: '9.7rem', // 适应小屏幕分辨率 - ROW_MAX_WIDTH: '11.7rem' // 适应大屏幕分辨率 } diff --git a/client/containers/ProjectGroups/ProjectGroups.scss b/client/containers/ProjectGroups/ProjectGroups.scss index 53a31cf5..e57e92c8 100644 --- a/client/containers/ProjectGroups/ProjectGroups.scss +++ b/client/containers/ProjectGroups/ProjectGroups.scss @@ -1,4 +1,6 @@ +@import '../../styles/mixin.scss'; + .g-doc { - max-width: 11rem; + @include row-width-limit; margin: .24rem auto; } diff --git a/client/styles/mixin.scss b/client/styles/mixin.scss new file mode 100644 index 00000000..0489cf44 --- /dev/null +++ b/client/styles/mixin.scss @@ -0,0 +1,4 @@ +@mixin row-width-limit { + max-width: 11.7rem; + min-width: 9.7rem; +} From f58b2fa7944e36fa8ac774461b433cb45c1816b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9D=E9=91=AB=E5=A5=94?= Date: Wed, 26 Jul 2017 22:03:18 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0eslint=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=A0=BC=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 42 +++++++++++ client/Application.js | 47 ++++++------ gulpfile.js | 2 +- package.json | 4 +- server/app.js | 45 +++++------- server/config.js | 32 ++++----- server/controllers/user.js | 2 +- server/install.js | 42 +++++------ server/models/base.js | 24 +++---- server/models/group.js | 56 ++++++++------- server/models/interface.js | 65 +++++++++-------- server/models/log.js | 24 ++++--- server/models/project.js | 117 +++++++++++++++--------------- server/models/user.js | 100 ++++++++++++++------------ server/router.js | 88 +++++++++++------------ server/utils/commons.js | 123 +++++++++++++++++++------------- server/utils/db.js | 25 ++++--- server/utils/initConfig.js | 14 ++-- server/yapi.js | 38 +++++----- server_dist/app.js | 1 + server_dist/config.js | 32 ++++----- server_dist/install.js | 23 +++--- server_dist/models/base.js | 1 + server_dist/models/interface.js | 6 +- server_dist/models/log.js | 1 + server_dist/models/project.js | 7 +- server_dist/models/user.js | 14 +--- server_dist/utils/commons.js | 64 ++++++++++++----- server_dist/utils/db.js | 4 ++ server_dist/utils/initConfig.js | 2 +- 30 files changed, 572 insertions(+), 473 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..1c80996a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,42 @@ +module.exports = { + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "parser": "babel-eslint", + "parserOptions": { + "ecmaFeatures": { + "experimentalObjectRestSpread": true, + "jsx": true + }, + "sourceType": "module" + }, + "plugins": [ + "react" + ], + "rules": { + "indent": [ + "error", + 4, + { + "SwitchCase": 1 + } + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ], + "strict": 0 + } +}; \ No newline at end of file diff --git a/client/Application.js b/client/Application.js index 8212403e..8e19d7ec 100644 --- a/client/Application.js +++ b/client/Application.js @@ -1,22 +1,22 @@ -import React, { Component } from 'react' -import { connect } from 'react-redux' -import PropTypes from 'prop-types' -import { Route, HashRouter, Redirect, Switch } from 'react-router-dom' -import { Home, ProjectGroups, Interface, News, AddInterface } from './containers/index' -import User from './containers/User/User.js' -import Header from './components/Header/Header' -import Footer from './components/Footer/Footer' -import Loading from './components/Loading/Loading' -import { checkLoginState } from './actions/login' +import React, { Component } from 'react'; +import { connect } from 'react-redux'; +import PropTypes from 'prop-types'; +import { Route, HashRouter, Redirect, Switch } from 'react-router-dom'; +import { Home, ProjectGroups, Interface, News, AddInterface } from './containers/index'; +import User from './containers/User/User.js'; +import Header from './components/Header/Header'; +import Footer from './components/Footer/Footer'; +import Loading from './components/Loading/Loading'; +import { checkLoginState } from './actions/login'; import { requireAuthentication } from './components/AuthenticatedComponent'; const LOADING_STATUS = 0; @connect( state => { - return{ - loginState:state.login.loginState - } + return { + loginState: state.login.loginState + }; }, { checkLoginState @@ -27,20 +27,22 @@ export default class App extends Component { super(props); this.state = { login: LOADING_STATUS - } + }; } + static propTypes = { - checkLoginState:PropTypes.func, - loginState:PropTypes.number - } + checkLoginState: PropTypes.func, + loginState: PropTypes.number + }; componentDidMount() { this.props.checkLoginState(); } + route = (status) => { let r; if (status === LOADING_STATUS) { - return + return ; } else { r = ( @@ -50,20 +52,21 @@ export default class App extends Component { - + - + -