From 2aa10f7930091030743b304bb36f6597e9200900 Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 14 Sep 2020 14:52:26 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=202.7.3.RELEASE=20=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E5=A4=9A=E7=A7=9F=E6=88=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/ThirdRegister/index.js | 22 +++++++++++---------- src/models/tenant.js | 22 ++++++++++++++++++++- src/pages/Dashboard/Workplace.js | 17 ++++++++++++---- src/pages/Login/Login.js | 28 ++++++++++++++++++++------- src/pages/System/Role/Role.js | 2 +- src/pages/System/Tenant/TenantAdd.js | 3 +++ src/pages/System/Tenant/TenantEdit.js | 5 +++++ src/pages/System/Tenant/TenantView.js | 3 +++ src/services/role.js | 2 +- src/services/tenant.js | 4 ++++ 11 files changed, 85 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 63489cc..b2aed54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sword", - "version": "2.7.2", + "version": "2.7.3", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { diff --git a/src/components/ThirdRegister/index.js b/src/components/ThirdRegister/index.js index c57294e..bcfdb22 100644 --- a/src/components/ThirdRegister/index.js +++ b/src/components/ThirdRegister/index.js @@ -1,12 +1,12 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; +import router from 'umi/router'; import { Card, Col, Form, Input, Modal, Button, Row, message } from 'antd'; import styles from '@/layouts/Sword.less'; import { getCurrentUser, removeAll } from '@/utils/authority'; import { validateNull } from '@/utils/utils'; import { tenantMode } from '@/defaultSettings'; import { getUserInfo, registerGuest } from '@/services/user'; -import router from 'umi/router'; const FormItem = Form.Item; @@ -23,7 +23,10 @@ class ThirdRegister extends PureComponent { componentDidMount() { const user = getCurrentUser(); - if (validateNull(user) || validateNull(user.userId) || user.userId < 0) { + if (validateNull(user)) { + removeAll(); + router.push('/user/login'); + } else if (validateNull(user.userId) || user.userId < 0) { // 第三方注册用户,弹出注册框 this.setState({ visible: true, user }); } else { @@ -60,9 +63,7 @@ class ThirdRegister extends PureComponent { }; render() { - const { - form, - } = this.props; + const { form } = this.props; const { loading, visible, user } = this.state; @@ -113,7 +114,7 @@ class ThirdRegister extends PureComponent { message: '请输入租户编号', }, ], - })()} + })()} @@ -129,7 +130,7 @@ class ThirdRegister extends PureComponent { }, ], initialValue: user.name, - })()} + })()} @@ -142,7 +143,7 @@ class ThirdRegister extends PureComponent { }, ], initialValue: user.account, - })()} + })()} @@ -156,7 +157,7 @@ class ThirdRegister extends PureComponent { message: '请输入密码', }, ], - })()} + })()} @@ -168,7 +169,7 @@ class ThirdRegister extends PureComponent { message: '请输入确认密码', }, ], - })()} + })()} @@ -178,4 +179,5 @@ class ThirdRegister extends PureComponent { ); } } + export default ThirdRegister; diff --git a/src/models/tenant.js b/src/models/tenant.js index a49e163..59fcada 100644 --- a/src/models/tenant.js +++ b/src/models/tenant.js @@ -1,7 +1,7 @@ import { message } from 'antd'; import router from 'umi/router'; import { TENANT_NAMESPACE } from '../actions/tenant'; -import { list, submit, detail, remove } from '../services/tenant'; +import { list, submit, detail, remove, info } from '../services/tenant'; export default { namespace: TENANT_NAMESPACE, @@ -11,6 +11,9 @@ export default { pagination: false, }, detail: {}, + info: { + tenantId: '000000', + }, }, effects: { *fetchList({ payload }, { call, put }) { @@ -40,6 +43,17 @@ export default { }); } }, + *fetchInfo({ payload }, { call, put }) { + const response = yield call(info, payload); + if (response.success && response.data.tenantId) { + yield put({ + type: 'saveInfo', + payload: { + info: response.data, + }, + }); + } + }, *clearDetail({ payload }, { put }) { yield put({ type: 'removeDetail', @@ -77,6 +91,12 @@ export default { detail: action.payload.detail, }; }, + saveInfo(state, action) { + return { + ...state, + info: action.payload.info, + }; + }, removeDetail(state) { return { ...state, diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js index af6f370..7daf8bc 100644 --- a/src/pages/Dashboard/Workplace.js +++ b/src/pages/Dashboard/Workplace.js @@ -20,14 +20,14 @@ class Workplace extends PureComponent {
- Downloads + Downloads Build Status Coverage Status Downloads @@ -212,7 +212,16 @@ class Workplace extends PureComponent { - + + +
1.升级至 SpringCloud Hoxton.SR8
+
2.升级至 Mybatis-Plus 3.4.0
+
3.重构Mybatis-Plus封装适配最新版
+
4.多租户增加域名绑定功能
+
5.创建多租户的同时创建对应的管理用户
+
6.优化日志模块分页排序
+
7.关闭日志模块外置api放行
+
1.升级至 SpringCloud Hoxton.SR7
2.升级至 SpringBoot 2.2.9.RELEASE
diff --git a/src/pages/Login/Login.js b/src/pages/Login/Login.js index 4244a50..588f464 100644 --- a/src/pages/Login/Login.js +++ b/src/pages/Login/Login.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { formatMessage, FormattedMessage } from 'umi/locale'; -import { Checkbox, Alert, Icon, Row, Col, Card, Spin } from 'antd'; +import { Checkbox, Alert, Icon, Row, Col, Card } from 'antd'; import Login from '../../components/Login'; import styles from './Login.less'; import { tenantMode, captchaMode, authUrl } from '../../defaultSettings'; @@ -9,8 +9,9 @@ import { getQueryString, getTopUrl, validateNull } from '@/utils/utils'; const { Tab, TenantId, UserName, Password, Captcha, Submit } = Login; -@connect(({ login, loading }) => ({ +@connect(({ login, tenant, loading }) => ({ login, + tenant, submitting: loading.effects['login/login'], })) class LoginPage extends Component { @@ -46,6 +47,10 @@ class LoginPage extends Component { type: 'menu/fetchMenuData', payload: { routes, authority }, }); + dispatch({ + type: 'tenant/fetchInfo', + payload: { domain }, + }); } } @@ -73,10 +78,13 @@ class LoginPage extends Component { handleSubmit = (err, values) => { const { type } = this.state; if (!err) { - const { dispatch } = this.props; + const { dispatch, + tenant: { info } } = this.props; + const { tenantId } = info; dispatch({ type: 'login/login', payload: { + tenantId, ...values, type, }, @@ -99,8 +107,14 @@ class LoginPage extends Component { ); render() { - const { login, submitting } = this.props; - const { type, autoLogin, loading } = this.state; + const { + login, + submitting, + tenant: { info }, + } = this.props; + const { type, autoLogin } = this.state; + const { tenantId } = info; + const tenantVisible = tenantMode && tenantId === '000000'; return (
{ + ROLE_GRANT({ roleIds: keys, menuIds: roleCheckedTreeKeys }, () => { this.setState({ visible: false, confirmLoading: false, diff --git a/src/pages/System/Tenant/TenantAdd.js b/src/pages/System/Tenant/TenantAdd.js index c1d5ec4..14a700f 100644 --- a/src/pages/System/Tenant/TenantAdd.js +++ b/src/pages/System/Tenant/TenantAdd.js @@ -86,6 +86,9 @@ class TenantAdd extends PureComponent {