From 58ff0840ab115f3b1fb0e485ffb602962c17bf7d Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 1 Aug 2024 18:36:56 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E3=80=90=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E3=80=91=E7=AD=9B=E9=80=89=E7=BB=84=E4=BB=B6=E6=9C=AA=E5=8F=97?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=9D=83=E9=99=90=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/impl/direct/DirectFieldService.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java b/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java index bdb0ee9102..bbd73f6a19 100644 --- a/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java +++ b/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java @@ -1,10 +1,14 @@ package io.dataease.service.dataset.impl.direct; import com.google.gson.Gson; +import io.dataease.auth.entity.SysUserEntity; +import io.dataease.auth.service.AuthUserService; import io.dataease.commons.model.BaseTreeNode; +import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.BeanUtils; import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.TreeUtils; +import io.dataease.dto.dataset.DataSetTableDTO; import io.dataease.dto.dataset.DataSetTableUnionDTO; import io.dataease.plugins.common.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DeSortDTO; @@ -53,6 +57,8 @@ public class DirectFieldService implements DataSetFieldService { private EngineService engineService; @Resource private PermissionsTreeService permissionsTreeService; + @Resource + private AuthUserService authUserService; @Override public List fieldValues(String fieldId, Long userId, Boolean userPermissions, Boolean rowAndColumnMgm) throws Exception { @@ -107,7 +113,13 @@ public class DirectFieldService implements DataSetFieldService { DatasetTable datasetTable = dataSetTableService.get(field.getTableId()); if (ObjectUtils.isEmpty(datasetTable) || StringUtils.isEmpty(datasetTable.getName())) return null; - + SysUserEntity userEntity = userId != null ? authUserService.getUserById(userId) : AuthUtils.getUser(); + if (userEntity != null && !userEntity.getIsAdmin()) { + DataSetTableDTO withPermission = dataSetTableService.getWithPermission(datasetTable.getId(), userEntity.getUserId()); + if (ObjectUtils.isEmpty(withPermission.getPrivileges()) || !withPermission.getPrivileges().contains("use")) { + DataEaseException.throwException(Translator.get("i18n_dataset_no_permission") + String.format(":table name [%s]", withPermission.getName())); + } + } DatasetTableField datasetTableField = DatasetTableField.builder().tableId(field.getTableId()).checked(Boolean.TRUE).build(); List fields = dataSetTableFieldsService.list(datasetTableField); From 277bb0910ae939b487562edd11aa9c04342f0b2b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 15 Aug 2024 12:30:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E5=8D=87=E7=BA=A7tomcat=E5=88=B09.0?= =?UTF-8?q?.64=E8=A7=84=E9=81=BFCVE-2024-21733?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index bedd5b7f43..3917421731 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,7 @@ 1.18.24 4.1.1 3.1.0 + 9.0.64 dataease From c94e3c5caaa5946d94d690f76fb0662de4da96d6 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 26 Aug 2024 11:11:23 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E9=80=8F?= =?UTF-8?q?=E8=A7=86=E8=A1=A8=E6=94=AF=E6=8C=81=E6=A0=91=E5=BD=A2=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/lang/en.js | 3 +++ core/frontend/src/lang/tw.js | 3 +++ core/frontend/src/lang/zh.js | 3 +++ core/frontend/src/views/chart/chart/chart.js | 1 + .../src/views/chart/chart/table/table-info.js | 9 ++++++--- core/frontend/src/views/chart/chart/util.js | 3 ++- .../components/shapeAttr/SizeSelectorAntV.vue | 17 +++++++++++++++++ 7 files changed, 35 insertions(+), 4 deletions(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index 183fcd8e8f..7738bc3c28 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -1615,6 +1615,9 @@ export default { table_freeze: 'Table Freeze', table_config: 'Table Config', table_column_width_config: 'Column Width', + table_layout_mode: 'Layout Mode', + table_layout_grid: 'Grid', + table_layout_tree: 'Tree', table_column_adapt: 'Adapt', table_column_custom: 'Custom', table_column_fixed: 'Fixed', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index 6d21799be1..4814e4daf2 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -1613,6 +1613,9 @@ export default { column: '列', table_config: '表格配置', table_column_width_config: '列寬調整', + table_layout_mode: '展示形式', + table_layout_grid: '平鋪展示', + table_layout_tree: '樹形模式', table_freeze: '表格凍結', table_column_adapt: '自適應', table_column_custom: '自定義', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index fbbcd58df5..0ba6f16e07 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -1611,6 +1611,9 @@ export default { table_freeze: '表格冻结', table_config: '表格配置', table_column_width_config: '列宽调整', + table_layout_mode: '展示形式', + table_layout_grid: '平铺展示', + table_layout_tree: '树形模式', table_column_adapt: '自适应', table_column_custom: '自定义', table_column_fixed: '固定列宽', diff --git a/core/frontend/src/views/chart/chart/chart.js b/core/frontend/src/views/chart/chart/chart.js index 2ef733afe1..e5d8cfaa0f 100644 --- a/core/frontend/src/views/chart/chart/chart.js +++ b/core/frontend/src/views/chart/chart/chart.js @@ -110,6 +110,7 @@ export const DEFAULT_SIZE = { show: false }, tableFieldWidth: [], + tableLayoutMode: 'grid', gaugeMinType: 'fix', // fix or dynamic gaugeMinField: { id: '', diff --git a/core/frontend/src/views/chart/chart/table/table-info.js b/core/frontend/src/views/chart/chart/table/table-info.js index d25229c4ef..8f7d2e824d 100644 --- a/core/frontend/src/views/chart/chart/table/table-info.js +++ b/core/frontend/src/views/chart/chart/table/table-info.js @@ -659,12 +659,14 @@ export function baseTablePivot(container, chart, action, headerAction, tableData data: newData, sortParams: sortParams } - // options const s2Options = { width: containerDom.offsetWidth, height: containerDom.offsetHeight, - style: getSize(chart), + style: { + hierarchyCollapse: true, + ...getSize(chart) + }, totals: totalCfg, conditions: getConditions(chart), tooltip: { @@ -676,7 +678,8 @@ export function baseTablePivot(container, chart, action, headerAction, tableData position: 'absolute', padding: '4px 2px' } - } + }, + hierarchyType: customAttr.size.tableLayoutMode ?? 'grid' } // 开始渲染 diff --git a/core/frontend/src/views/chart/chart/util.js b/core/frontend/src/views/chart/chart/util.js index 81dc6fbe37..bbaf1b0b2f 100644 --- a/core/frontend/src/views/chart/chart/util.js +++ b/core/frontend/src/views/chart/chart/util.js @@ -178,7 +178,8 @@ export const TYPE_CONFIGS = [ 'tableColumnMode', 'tableRowTooltip', 'tableColTooltip', - 'tableCellTooltip' + 'tableCellTooltip', + 'tableLayoutMode' ], 'total-cfg': [ 'row', diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue index 1970d124da..5a63ca5278 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue @@ -163,6 +163,22 @@ + + + {{ $t('chart.table_layout_grid') }} + + {{ $t('chart.table_layout_tree') }} + + + Date: Thu, 5 Sep 2024 10:36:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8C=89=E9=92=AE=E6=8E=A7=E5=88=B6=E9=80=89=E9=A1=B9?= =?UTF-8?q?#11631?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/Preview.vue | 5 ++- .../src/components/canvas/utils/utils.js | 1 + core/frontend/src/lang/en.js | 2 ++ core/frontend/src/lang/tw.js | 2 ++ core/frontend/src/lang/zh.js | 2 ++ core/frontend/src/views/panel/panel.js | 1 + .../panelStyle/OverallSetting.vue | 32 ++++++++++++++++++- 7 files changed, 43 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/components/canvas/components/editor/Preview.vue b/core/frontend/src/components/canvas/components/editor/Preview.vue index 2c3867c7e4..1a1baf08d7 100644 --- a/core/frontend/src/components/canvas/components/editor/Preview.vue +++ b/core/frontend/src/components/canvas/components/editor/Preview.vue @@ -16,7 +16,7 @@ @back-to-top="backToTop" /> - + {{ $t('panel.panel_view_result_show') }} @@ -182,6 +182,36 @@ + + + + + {{ $t('panel.public_link_button_show') }} + + + + +
+ {{ $t('panel.public_link_button_tips') }} +
+ +
+
+
+
+
+
From 40c51a8542dce6c38a29be39f8c5a280ee8659bb Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 5 Sep 2024 10:41:08 +0800 Subject: [PATCH 5/6] =?UTF-8?q?style(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panel/subjectSetting/panelStyle/OverallSetting.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue b/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue index 7a1ade5068..f9a3887ce5 100644 --- a/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue +++ b/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue @@ -93,7 +93,7 @@ @change="themeChange" >{{ $t('panel.refresh_browser_frequency') }} - + {{ $t('panel.panel_view_result_show') }} - + {{ $t('panel.public_link_button_show') }} - + Date: Thu, 5 Sep 2024 15:48:31 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix(X-Pack):=20CAS=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=BF=E7=94=A8=E5=AE=9A=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/auth/config/cas/CasStrategy.java | 22 +++++++- .../java/io/dataease/auth/util/JWTUtils.java | 12 ++++ .../strategy/impl/EmailTaskHandler.java | 10 +++- core/frontend/public/link.html | 55 +++++++++++-------- 4 files changed, 71 insertions(+), 28 deletions(-) diff --git a/core/backend/src/main/java/io/dataease/auth/config/cas/CasStrategy.java b/core/backend/src/main/java/io/dataease/auth/config/cas/CasStrategy.java index 82d5187a82..b1b6990dff 100644 --- a/core/backend/src/main/java/io/dataease/auth/config/cas/CasStrategy.java +++ b/core/backend/src/main/java/io/dataease/auth/config/cas/CasStrategy.java @@ -1,9 +1,14 @@ package io.dataease.auth.config.cas; +import com.auth0.jwt.JWT; +import com.auth0.jwt.interfaces.Claim; +import com.auth0.jwt.interfaces.DecodedJWT; import io.dataease.auth.service.impl.ShiroServiceImpl; import io.dataease.commons.utils.CommonBeanFactory; +import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.ServletUtils; import io.dataease.service.system.SystemParameterService; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.util.AntPathMatcher; import org.jasig.cas.client.authentication.UrlPatternMatcherStrategy; @@ -38,9 +43,9 @@ public class CasStrategy implements UrlPatternMatcherStrategy { s = s.substring(beginIndex + serverName.length()); } if (StringUtils.equals("/", s)) { - if (fromLink(serverName)) return true; - return false; + return fromLink(serverName); } + if (fromShot()) return true; if (StringUtils.equals("/login", s)) return false; if (StringUtils.startsWith(s, "/cas/callBack")) return false; if (StringUtils.equals("/api/auth/deLogout", s)) return true; @@ -74,4 +79,17 @@ public class CasStrategy implements UrlPatternMatcherStrategy { } return false; } + + private Boolean fromShot() { + String token = ServletUtils.getToken(); + if (StringUtils.isBlank(token)) return false; + try { + DecodedJWT jwt = JWT.decode(token); + Claim forShot = jwt.getClaim("forShot"); + return ObjectUtils.isNotEmpty(forShot) && forShot.asBoolean(); + } catch (Exception e) { + LogUtil.error(e.getMessage()); + return false; + } + } } diff --git a/core/backend/src/main/java/io/dataease/auth/util/JWTUtils.java b/core/backend/src/main/java/io/dataease/auth/util/JWTUtils.java index 9817264a00..3a6ef78157 100644 --- a/core/backend/src/main/java/io/dataease/auth/util/JWTUtils.java +++ b/core/backend/src/main/java/io/dataease/auth/util/JWTUtils.java @@ -125,6 +125,18 @@ public class JWTUtils { return IPUtils.get(); } + public static String signShotToken(TokenInfo tokenInfo, String secret) { + Long userId = tokenInfo.getUserId(); + long expireTimeMillis = getExpireTime(); + Date date = new Date(System.currentTimeMillis() + expireTimeMillis); + Algorithm algorithm = Algorithm.HMAC256(secret); + Builder builder = JWT.create() + .withClaim("username", tokenInfo.getUsername()) + .withClaim("forShot", true) + .withClaim("userId", userId); + return builder.withExpiresAt(date).sign(algorithm); + } + public static String sign(TokenInfo tokenInfo, String secret, boolean writeOnline) { Long userId = tokenInfo.getUserId(); diff --git a/core/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java b/core/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java index d358691b26..3f673ce971 100644 --- a/core/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java +++ b/core/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java @@ -435,9 +435,7 @@ public class EmailTaskHandler extends TaskHandler implements Job { private String tokenByUser(SysUserEntity user) { TokenInfo tokenInfo = TokenInfo.builder().userId(user.getUserId()).username(user.getUsername()).build(); - String token = JWTUtils.sign(tokenInfo, user.getPassword(), false); - - return token; + return JWTUtils.signShotToken(tokenInfo, user.getPassword()); } private String panelUrl(String panelId) { @@ -445,4 +443,10 @@ public class EmailTaskHandler extends TaskHandler implements Job { return domain + "/#/previewScreenShot/" + panelId + "/true"; } + public static void main(String[] args) { + TokenInfo tokenInfo = TokenInfo.builder().userId(1L).username("admin").build(); + String contextPath = JWTUtils.signShotToken(tokenInfo, "ae8000252199d4f2aa00e3b99e6f9934"); + System.out.println(contextPath); + } + } diff --git a/core/frontend/public/link.html b/core/frontend/public/link.html index 635a6d4f8d..891957b9af 100644 --- a/core/frontend/public/link.html +++ b/core/frontend/public/link.html @@ -29,30 +29,39 @@ } return (false) } - const link = getQueryVariable('link') - const user = getQueryVariable('user') - const terminal = getQueryVariable('terminal') - const attachParams = getQueryVariable('attachParams') - const fromLink = getQueryVariable('fromLink') - const ticket = getQueryVariable('ticket') - const baseUrl = window.location.pathname.replace('link.html', '') - let url = baseUrl + "#/delink?link=" + encodeURIComponent(link) - if (terminal) { - url += '&terminal=' + terminal + const shot = getQueryVariable('shot') + if (shot) { + const panelId = getQueryVariable('panelId') + const baseUrl = window.location.pathname.replace('link.html', '') + const shoturl = baseUrl + "#/previewScreenShot/" + panelId + "/true" + window.location.href = shoturl + } else { + const link = getQueryVariable('link') + const user = getQueryVariable('user') + const terminal = getQueryVariable('terminal') + const attachParams = getQueryVariable('attachParams') + const fromLink = getQueryVariable('fromLink') + const ticket = getQueryVariable('ticket') + const baseUrl = window.location.pathname.replace('link.html', '') + let url = baseUrl + "#/delink?link=" + encodeURIComponent(link) + if (terminal) { + url += '&terminal=' + terminal + } + if (user) { + url += '&user=' + encodeURIComponent(user) + } + if (attachParams) { + url += '&attachParams=' + encodeURIComponent(attachParams) + } + if (fromLink) { + url += '&fromLink=' + fromLink + } + if (ticket) { + url += '&ticket=' + ticket + } + window.location.href = url } - if (user) { - url += '&user=' + encodeURIComponent(user) - } - if (attachParams) { - url += '&attachParams=' + encodeURIComponent(attachParams) - } - if (fromLink) { - url += '&fromLink=' + fromLink - } - if (ticket) { - url += '&ticket=' + ticket - } - window.location.href = url +