From 12f2148030ed17f11330552c3cabe3b44f02264b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 22 Apr 2021 12:43:56 +0800 Subject: [PATCH 01/20] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=BF=87=E6=9C=9F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/auth/filter/JWTFilter.java | 11 +++++++++-- .../java/io/dataease/auth/util/JWTUtils.java | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java b/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java index 62316b95a9..f7a4b6ea33 100644 --- a/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java +++ b/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java @@ -55,12 +55,19 @@ public class JWTFilter extends BasicHttpAuthenticationFilter { throw new AuthenticationException(expireMessage); } if (JWTUtils.needRefresh(authorization)){ + String oldAuthorization = authorization; authorization = refreshToken(request, response); + JWTUtils.removeTokenExpire(oldAuthorization); } + // 删除老的操作时间 + JWTUtils.removeTokenExpire(authorization); + // 设置新的操作时间 + JWTUtils.addTokenExpire(authorization); JWTToken token = new JWTToken(authorization); Subject subject = getSubject(request, response); // 提交给realm进行登入,如果错误他会抛出异常并被捕获 subject.login(token); + return true; } @@ -98,10 +105,10 @@ public class JWTFilter extends BasicHttpAuthenticationFilter { String password = user.getPassword(); // 删除老token操作时间 - JWTUtils.removeTokenExpire(token); + // JWTUtils.removeTokenExpire(token); String newToken = JWTUtils.sign(tokenInfo, password); // 记录新token操作时间 - JWTUtils.addTokenExpire(newToken); + // JWTUtils.addTokenExpire(newToken); JWTToken jwtToken = new JWTToken(newToken); this.getSubject(request, response).login(jwtToken); 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 1b4026dede..9b171a936f 100644 --- a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java +++ b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java @@ -20,9 +20,9 @@ public class JWTUtils { // token过期时间1min (过期会自动刷新续命 目的是避免一直都是同一个token ) - private static final long EXPIRE_TIME = 5*60*1000; + private static final long EXPIRE_TIME = 1*60*1000; // 登录间隔时间10min 超过这个时间强制重新登录 - private static final long Login_Interval = 30*60*1000; + private static final long Login_Interval = 10*60*1000; /** @@ -81,8 +81,17 @@ public class JWTUtils { public static boolean loginExpire(String token){ Long now = System.currentTimeMillis(); Long lastOperateTime = tokenLastOperateTime(token); - if (lastOperateTime == null) return true; - return now - lastOperateTime > Login_Interval; + boolean isExpire = false; + if (lastOperateTime != null) { + isExpire = now - lastOperateTime > Login_Interval; + } + if (isExpire) { + System.out.println("-----------------------"); + System.out.println("-----上次操作时间是["+lastOperateTime+"]-----"); + System.out.println("-----当前操作时间是["+now+"]-----"); + System.out.println("-----------------------"); + } + return isExpire; } public static Date getExp(String token) { From 69f5a09cdcdd64a9a0fd0726a1ee32a7eeda56d8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 22 Apr 2021 13:46:59 +0800 Subject: [PATCH 02/20] =?UTF-8?q?feat:=20=E8=A7=A3=E5=86=B3=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=85=B3=E9=97=AD=E5=B7=A6=E4=BE=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Toolbar.vue | 5 ++++- frontend/src/views/panel/edit/index.vue | 10 +++++++--- frontend/src/views/panel/index.vue | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 9342e441e7..6c297b9475 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -87,7 +87,10 @@ export default { }, methods: { closePanelEdit() { - bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) + this.$emit('close-left-panel') + this.$nextTick(() => { + bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) + }) }, goFile() { this.$refs.files.click() diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 037ff93909..512eb4968f 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -6,7 +6,7 @@ 名称:{{ panelInfo.name || '测试仪表板' }} - + @@ -44,10 +44,10 @@
-
+
- +
@@ -349,6 +349,10 @@ export default { this.currentWidget = ApplicationContext.getService(serviceName) this.currentFilterCom = this.curComponent this.openFilterDiolog() + }, + closeLeftPanel() { + this.show = false + this.beforeDestroy() } } } diff --git a/frontend/src/views/panel/index.vue b/frontend/src/views/panel/index.vue index 32ca274ad3..cc2d25bc39 100644 --- a/frontend/src/views/panel/index.vue +++ b/frontend/src/views/panel/index.vue @@ -1,5 +1,5 @@ + + diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 2788ae932b..36480d194d 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -114,7 +114,7 @@
- + @@ -195,7 +195,8 @@ - + + @@ -262,10 +263,11 @@ import XAxisSelector from '../components/component-style/XAxisSelector' import YAxisSelector from '../components/component-style/YAxisSelector' import BackgroundColorSelector from '../components/component-style/BackgroundColorSelector' import QuotaFilterEditor from '../components/filter/QuotaFilterEditor' +import TableNormal from '../components/table/TableNormal' export default { name: 'ChartEdit', - components: { DatasetChartDetail, QuotaFilterEditor, BackgroundColorSelector, FilterItem, XAxisSelector, YAxisSelector, TooltipSelector, LabelSelector, LegendSelector, TitleSelector, SizeSelector, ColorSelector, ChartComponent, QuotaItem, DimensionItem, draggable }, + components: { TableNormal, DatasetChartDetail, QuotaFilterEditor, BackgroundColorSelector, FilterItem, XAxisSelector, YAxisSelector, TooltipSelector, LabelSelector, LegendSelector, TitleSelector, SizeSelector, ColorSelector, ChartComponent, QuotaItem, DimensionItem, draggable }, props: { param: { type: Object, From 461b0dda246aa4577cd2d1df93cb7369a0a6817c Mon Sep 17 00:00:00 2001 From: junjie Date: Sun, 25 Apr 2021 18:49:57 +0800 Subject: [PATCH 13/20] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=20=E8=A1=A8=E6=A0=BC=20=E9=AB=98=E5=BA=A6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E7=95=8C=E9=9D=A2=E5=8F=98=E5=8A=A8=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/table/TableNormal.vue | 9 +++++++++ frontend/src/views/chart/view/ChartEdit.vue | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue index 4545a024ed..2e2b1caaf3 100644 --- a/frontend/src/views/chart/components/table/TableNormal.vue +++ b/frontend/src/views/chart/components/table/TableNormal.vue @@ -54,6 +54,7 @@ export default { } }, mounted() { + this.calcHeight() this.init() }, methods: { @@ -61,6 +62,14 @@ export default { this.fields = JSON.parse(JSON.stringify(this.chart.data.fields)) const datas = JSON.parse(JSON.stringify(this.chart.data.tableRow)) this.$refs.plxTable.reloadData(datas) + const that = this + window.onresize = function() { + that.calcHeight() + } + }, + calcHeight() { + const currentHeight = document.documentElement.clientHeight + this.height = currentHeight - 56 - 40 - 84 - 24 - 16 * 2 - 20 } } } diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 36480d194d..c48e6477c9 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -196,7 +196,7 @@ - + From 0c477f5bcf618e4db6741d3c9b21b9b38bac3922 Mon Sep 17 00:00:00 2001 From: junjie Date: Mon, 26 Apr 2021 12:35:47 +0800 Subject: [PATCH 14/20] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=20=E8=A1=A8=E6=A0=BC=20=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E6=94=AF=E6=8C=81'=E6=A0=87=E9=A2=98'?= =?UTF-8?q?=E4=B8=8E'=E8=83=8C=E6=99=AF'=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component-style/TitleSelector.vue | 2 +- .../chart/components/table/TableNormal.vue | 48 ++++++++++++++++--- frontend/src/views/chart/view/ChartEdit.vue | 12 +++-- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 400f1b37bc..75747febb3 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/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue index 2e2b1caaf3..9f28765d62 100644 --- a/frontend/src/views/chart/components/table/TableNormal.vue +++ b/frontend/src/views/chart/components/table/TableNormal.vue @@ -1,6 +1,6 @@