From 19001b763a46c94a5ac7064bad9ac919dccaabf5 Mon Sep 17 00:00:00 2001 From: duanledexianxianxian Date: Thu, 27 Jun 2019 19:05:06 +0800 Subject: [PATCH] sync code --- src/config.js | 6 +++--- src/global.less | 1 + src/layouts/BasicLayout.tsx | 5 ++++- src/layouts/BlankLayout.tsx | 3 +-- src/layouts/UserLayout.less | 4 ++++ src/layouts/UserLayout.tsx | 2 +- src/pages/user/login/index.js | 2 +- src/pages/user/login/index.less | 5 +++-- src/pages/user/login/models/index.js | 2 +- src/themes/vars.less | 1 + 10 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/config.js b/src/config.js index cad0e5fc..8705dfd0 100644 --- a/src/config.js +++ b/src/config.js @@ -1,15 +1,15 @@ // import store from './utils/store'; export default { - baseUrl: 'http://127.0.0.1:8080', + baseUrl: 'http://platform.kuopu.net:9080', storeNameSpace: 'kim', headers: () => ({ Authorization: - 'eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjMzLCJ1c24iOiLmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrociLCJzdGEiOjE1NjE0MzAzMzI4NzQsImxpZCI6Im91eWFuZ2JveXUifQ.209scGXfvjPj7KgvXhzrI4ciHg6aTDt8LQ1Z2Nw-ZxA', + 'eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjMzLCJ1c24iOiLmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrofmrKfpmLPljZrlrociLCJzdGEiOjE1NjE2MDE3ODA3NDksImxpZCI6Im91eWFuZ2JveXUifQ.PY2oCcc9ESRVw2UmAnvZddgrl6Ycn2462L7xvI4FCLY', }), resCodeKey: 'code', // 后台正常返回错误编码 resMessageKey: 'message', // 后台正常返回错误编码 successCode: 'sys.success', // 后台正常返回错误编码 - isThrowError: true, + isThrowError: true, // 默认为true copyright: `${new Date().getFullYear()} KIM3.0技术中台部出品`, }; diff --git a/src/global.less b/src/global.less index 01dc7eee..ad04cbd7 100644 --- a/src/global.less +++ b/src/global.less @@ -4,6 +4,7 @@ html, body, #root { height: 100%; + font-size: 62.5%; } .colorWeak { diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 87587fed..94e7b3d4 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -36,7 +36,9 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & { const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => menuList.map(item => { + // 遍历给所有的children加上了[] const localItem = { ...item, children: item.children ? menuDataRender(item.children) : [] }; + // 检查菜单项是否有权限 return Authorized.check(item.authority, localItem, null) as MenuDataItem; }); @@ -115,7 +117,7 @@ const BasicLayout: React.FC = props => { ...routers, ]} footerRender={false} // 不显示footer - menuDataRender={menuDataRender} + menuDataRender={menuDataRender} // 渲染导航菜单列表 formatMessage={formatMessage} rightContentRender={rightProps => } {...props} @@ -123,6 +125,7 @@ const BasicLayout: React.FC = props => { > {children} + {/* 主题设置抽屉 */} diff --git a/src/layouts/BlankLayout.tsx b/src/layouts/BlankLayout.tsx index 35f28e8d..e48b005d 100644 --- a/src/layouts/BlankLayout.tsx +++ b/src/layouts/BlankLayout.tsx @@ -1,10 +1,9 @@ import React from 'react'; -import CopyBlock from '@/components/CopyBlock'; const Layout: React.FC = ({ children }) => ( <>
{children}
- + {/* */} ); diff --git a/src/layouts/UserLayout.less b/src/layouts/UserLayout.less index 06dd9ba1..6724067a 100755 --- a/src/layouts/UserLayout.less +++ b/src/layouts/UserLayout.less @@ -6,6 +6,9 @@ height: 100vh; overflow: auto; background: @layout-body-background; + .lang { + background: @primary-color; + } .content { padding: 0; } @@ -16,6 +19,7 @@ .ant-layout-footer { background: linear-gradient(#43cec4, #43cec4); .ant-pro-global-footer-copyright { + font-size: 10px; color: rgba(255, 255, 255, 0.6); } } diff --git a/src/layouts/UserLayout.tsx b/src/layouts/UserLayout.tsx index 5fa51523..33632a47 100644 --- a/src/layouts/UserLayout.tsx +++ b/src/layouts/UserLayout.tsx @@ -45,7 +45,7 @@ const UserLayout: React.SFC = props => {
{children}
- + ); diff --git a/src/pages/user/login/index.js b/src/pages/user/login/index.js index bb351e6a..1feeb182 100644 --- a/src/pages/user/login/index.js +++ b/src/pages/user/login/index.js @@ -25,7 +25,7 @@ class Login extends React.Component { const { username, password } = this.state; const { dispatch } = this.props; dispatch({ - type: 'login/login', + type: 'userLogin/login', payload: { userName: username, password }, }).then(({ code, data }) => { if (code === 'sys.success') { diff --git a/src/pages/user/login/index.less b/src/pages/user/login/index.less index 46900113..077fafc0 100644 --- a/src/pages/user/login/index.less +++ b/src/pages/user/login/index.less @@ -7,13 +7,14 @@ // background-size: cover; background: linear-gradient(@color-primary, @color-primary); width: 100%; - // height: 100vh; + min-height: 500px; + height: calc(~'100vh - 130px'); display: flex; justify-content: center; align-items: center; position: relative; .container { - // height: 500px; + // min-height: 500px; width: 500px; background-color: rgba(255, 255, 255, 0); //border-radius: 4px; diff --git a/src/pages/user/login/models/index.js b/src/pages/user/login/models/index.js index 404d5947..24235f10 100644 --- a/src/pages/user/login/models/index.js +++ b/src/pages/user/login/models/index.js @@ -2,7 +2,7 @@ import { login } from '../services'; const initData = {}; export default { - namespace: 'UserLogin', + namespace: 'userLogin', state: { ...initData, }, diff --git a/src/themes/vars.less b/src/themes/vars.less index 416c1a1a..fb8a7e5c 100644 --- a/src/themes/vars.less +++ b/src/themes/vars.less @@ -1,3 +1,4 @@ +@import '~antd/es/style/themes/default.less'; /** * author: liu.yang * date: 2018-08-22 09:09:23 -- GitLab