From 787123ae4ad0532a79a225340fd1931a3c69b135 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 27 Apr 2021 18:43:15 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix(frontend):=20=E8=A7=86=E5=9B=BE=20bug?= =?UTF-8?q?=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/component-style/TitleSelector.vue | 2 +- .../chart/components/shape-attr/ColorSelector.vue | 10 +++++----- .../chart/components/shape-attr/SizeSelector.vue | 14 +++++++------- frontend/src/views/chart/view/ChartEdit.vue | 10 +++++----- frontend/src/views/dataset/group/Group.vue | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 75747febb3..2955d5d166 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -26,7 +26,7 @@ {{ $t('chart.text_pos_right') }} - + {{ $t('chart.text_pos_top') }} {{ $t('chart.text_pos_center') }} diff --git a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue index da36e6547d..65bbfaca88 100644 --- a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue @@ -8,7 +8,7 @@ > - +
@@ -19,16 +19,16 @@ - + - + - + - + {{ $t('chart.stripe') }} diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue index a3404a0d2d..fbbde9c6fc 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue @@ -7,7 +7,7 @@ trigger="click" > - + {{ $t('chart.adapt') }} @@ -19,7 +19,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -58,7 +58,7 @@ - + {{ $t('chart.radius_mode') }} @@ -71,13 +71,13 @@ - + - + {{ $t('chart.polygon') }} @@ -86,7 +86,7 @@ - + diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index ff2378ea05..906c6ca9e5 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -129,14 +129,14 @@ - - + + - - - + + + diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index a488bf1e42..ab8dfc650b 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -204,7 +204,7 @@ - {{ $t('dataset.edit') }} + {{ $t('dataset.rename') }} From 65d1808488932d37401b22ebd2e568b2b8672cf0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 12:16:07 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E5=81=9C?= =?UTF-8?q?=E7=94=A8=E8=BF=98=E5=8F=AF=E4=BB=A5=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/dataease/auth/config/F2CRealm.java | 3 +++ .../src/main/java/io/dataease/auth/server/AuthServer.java | 6 +++++- .../main/java/io/dataease/service/sys/SysUserService.java | 8 ++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/config/F2CRealm.java b/backend/src/main/java/io/dataease/auth/config/F2CRealm.java index 46b942ef48..719f6db9d9 100644 --- a/backend/src/main/java/io/dataease/auth/config/F2CRealm.java +++ b/backend/src/main/java/io/dataease/auth/config/F2CRealm.java @@ -68,6 +68,9 @@ public class F2CRealm extends AuthorizingRealm { if (user == null) { throw new AuthenticationException("User didn't existed!"); } + if (user.getEnabled()==0) { + throw new AuthenticationException("User is valid!"); + } String pass = null; try { pass = user.getPassword(); diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index 6c454034f7..56211cab1d 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -35,10 +35,14 @@ public class AuthServer implements AuthApi { String username = loginDto.getUsername(); String password = loginDto.getPassword(); SysUserEntity user = authUserService.getUserByName(username); - String realPwd = user.getPassword(); + if (ObjectUtils.isEmpty(user)){ throw new RuntimeException("没有该用户!"); } + if (user.getEnabled()==0){ + throw new RuntimeException("用户已经失效!"); + } + String realPwd = user.getPassword(); //私钥解密 String pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, password); //md5加密 diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index 85ccfc0ef2..096eb96511 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -15,12 +15,12 @@ import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.request.SysUserCreateRequest; import io.dataease.controller.sys.request.SysUserPwdRequest; import io.dataease.controller.sys.request.SysUserStateRequest; -import io.dataease.controller.sys.request.UserGridRequest; import io.dataease.controller.sys.response.SysUserGridResponse; import io.dataease.controller.sys.response.SysUserRole; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -31,7 +31,10 @@ import java.util.stream.Collectors; @Service public class SysUserService { - private final static String DEFAULT_PWD = "DataEase123.."; + //private final static String DEFAULT_PWD = "DataEase123.."; + + @Value("${dataease.init_password:DataEase123..}") + private String DEFAULT_PWD; @Resource private SysUserMapper sysUserMapper; @@ -89,6 +92,7 @@ public class SysUserService { } + @CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId") public int updateStatus(SysUserStateRequest request){ SysUser sysUser = new SysUser(); sysUser.setUserId(request.getUserId()); From 1ed42b1fa58ab9172ab19d97364d1a3446a8cd0f Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 12:16:37 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/auth/util/JWTUtils.java | 12 +++++++++++- backend/src/main/resources/application.properties | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java index 9b171a936f..8dbed6faf2 100644 --- a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java +++ b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java @@ -13,6 +13,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authc.AuthenticationException; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; +import org.springframework.core.env.Environment; + import java.util.Date; @@ -22,7 +24,9 @@ public class JWTUtils { // token过期时间1min (过期会自动刷新续命 目的是避免一直都是同一个token ) private static final long EXPIRE_TIME = 1*60*1000; // 登录间隔时间10min 超过这个时间强制重新登录 - private static final long Login_Interval = 10*60*1000; + private static long Login_Interval; + + /** @@ -79,6 +83,11 @@ public class JWTUtils { * @return */ public static boolean loginExpire(String token){ + if (Login_Interval==0) { + String property = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.login_timeout"); + int seconds = StringUtils.isNotEmpty(property) ? Integer.parseInt(property): (10*60); + Login_Interval = seconds * 1000; + } Long now = System.currentTimeMillis(); Long lastOperateTime = tokenLastOperateTime(token); boolean isExpire = false; @@ -169,4 +178,5 @@ public class JWTUtils { long now = System.currentTimeMillis(); tokens_expire.put(token, now); } + } diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 93567fed38..69f15f7e2a 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -62,6 +62,10 @@ spring.mvc.log-request-details=true pagehelper.PageRowBounds=true #excel等用户上传文件路径 upload.file.path=/opt/dataease/data/upload/ +#用户初始密码,如果不设置默认是DataEase123.. +dataease.init_password=DataEase123456 +#登录超时时间单位s 设置默认30分钟 如果雨不设置 默认10分钟也就是10*60 +dataease.login_timeout=1800 From 2946017dd50f76b1fb1df09abb3c5cc0fdc32e06 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 12:16:52 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E8=A7=92=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/role/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/role/index.vue b/frontend/src/views/system/role/index.vue index d5eda06f63..95439ba971 100644 --- a/frontend/src/views/system/role/index.vue +++ b/frontend/src/views/system/role/index.vue @@ -107,7 +107,8 @@ export default { rule: { name: [ { required: true, message: '请输入名称', trigger: 'blur' } - ] + ], + code: [{ required: true, message: '请输入代码', trigger: 'blur' }] }, currentRow: null, permission: { From e8fa56654990740b3f58ae8e5a41880488eb7401 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 12:23:06 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=20=E4=B8=80=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=A6=81=E7=94=A8keep-alive=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/layout/components/AppMain.vue | 6 +++--- frontend/src/views/system/datasource/index.vue | 4 ++-- frontend/src/views/system/dept/index.vue | 2 +- frontend/src/views/system/menu/index.vue | 2 +- frontend/src/views/system/role/index.vue | 2 +- frontend/src/views/system/user/index.vue | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/layout/components/AppMain.vue b/frontend/src/layout/components/AppMain.vue index 475cfda6e5..b31f25780d 100644 --- a/frontend/src/layout/components/AppMain.vue +++ b/frontend/src/layout/components/AppMain.vue @@ -2,9 +2,9 @@
- - - + + +
diff --git a/frontend/src/views/system/datasource/index.vue b/frontend/src/views/system/datasource/index.vue index cb9a3e59ab..91b78928c5 100644 --- a/frontend/src/views/system/datasource/index.vue +++ b/frontend/src/views/system/datasource/index.vue @@ -154,7 +154,7 @@ export default { } } }, - activated() { + mounted() { this.search() }, methods: { @@ -199,7 +199,7 @@ export default { this.$success(this.$t('commons.save_success')) this.search() this.dialogVisible = false - }); + }) } else { return false } diff --git a/frontend/src/views/system/dept/index.vue b/frontend/src/views/system/dept/index.vue index fd65bcdbdb..e56d5d11dc 100644 --- a/frontend/src/views/system/dept/index.vue +++ b/frontend/src/views/system/dept/index.vue @@ -199,7 +199,7 @@ export default { isLazy: true } }, - activated() { + mounted() { this.form = Object.assign({}, this.defaultForm) this.search() }, diff --git a/frontend/src/views/system/menu/index.vue b/frontend/src/views/system/menu/index.vue index cbd91334e6..a9b976c1a6 100644 --- a/frontend/src/views/system/menu/index.vue +++ b/frontend/src/views/system/menu/index.vue @@ -195,7 +195,7 @@ export default { } }, - activated() { + mounted() { this.form = Object.assign({}, this.defaultForm) this.initTableData() }, diff --git a/frontend/src/views/system/role/index.vue b/frontend/src/views/system/role/index.vue index 95439ba971..45aa23ee4e 100644 --- a/frontend/src/views/system/role/index.vue +++ b/frontend/src/views/system/role/index.vue @@ -146,7 +146,7 @@ export default { watch: { currentRow: 'currentRowChange' }, - activated() { + mounted() { this.search() }, methods: { diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue index c999f3aa1f..e513059e3a 100644 --- a/frontend/src/views/system/user/index.vue +++ b/frontend/src/views/system/user/index.vue @@ -285,7 +285,7 @@ export default { } } }, - activated() { + mounted() { // this.form = Object.assign({}, this.defaultForm); this.allRoles() this.search() From be033a5c66fdf13b97ee531403019a461645d79f Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 13:27:56 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=20=E9=A1=B6=E7=BA=A7=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E4=B8=8D=E8=83=BD=E7=BC=96=E8=BE=91=E4=B8=BA=E9=9D=9E?= =?UTF-8?q?=E9=A1=B6=E7=BA=A7=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/dept/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/dept/index.vue b/frontend/src/views/system/dept/index.vue index e56d5d11dc..f1e053639b 100644 --- a/frontend/src/views/system/dept/index.vue +++ b/frontend/src/views/system/dept/index.vue @@ -86,7 +86,7 @@
- + @@ -507,6 +507,10 @@ export default { } }) return roots + }, + topChange(value) { + // console.log(value) + !value && (this.depts = null) } } From 52d31b504e2b7bf1a0c7ca30b55746c0d87015f0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Apr 2021 14:54:55 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=20=E8=A1=A8=E6=A0=BC=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E6=9C=80=E6=96=B0fit2cloud-ui=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 2 +- .../business/complex-table/index.vue | 31 +++++++++++-------- .../components/business/tree-table/index.vue | 24 +++++++++++--- .../src/views/system/datasource/index.vue | 6 ++-- frontend/src/views/system/dept/index.vue | 5 ++- frontend/src/views/system/menu/index.vue | 7 ++--- frontend/src/views/system/role/index.vue | 5 ++- frontend/src/views/system/user/index.vue | 5 ++- 8 files changed, 50 insertions(+), 35 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index dac5d81076..65c1a2ba34 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,7 +22,7 @@ "element-resize-detector": "^1.2.2", "element-ui": "2.13.0", "file-saver": "^2.0.5", - "fit2cloud-ui": "^0.1.12", + "fit2cloud-ui": "^1.1.1", "html2canvas": "^1.0.0-rc.7", "js-cookie": "2.2.0", "jsencrypt": "^3.0.0-rc.1", diff --git a/frontend/src/components/business/complex-table/index.vue b/frontend/src/components/business/complex-table/index.vue index fe330ee3a0..9c625a4edb 100644 --- a/frontend/src/components/business/complex-table/index.vue +++ b/frontend/src/components/business/complex-table/index.vue @@ -1,3 +1,4 @@ +