From 9662daabda7970fca695dcad51759ccb984204e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Thu, 6 Apr 2023 17:11:47 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-91727=20=E5=AF=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=BE=93=E5=85=A5=E7=9A=84=E5=8F=82=E6=95=B0=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E7=BB=9F=E4=B8=80=E6=A0=A1=E9=AA=8C=20feat=EF=BC=9Adc?= =?UTF-8?q?m=E4=BB=93=E5=BA=93=E9=87=8C=E9=9D=A2=E6=9C=89=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E5=9C=BA=E6=99=AF=EF=BC=8C=E8=BF=99=E9=87=8C=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E8=BF=9B=E6=9D=A5=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkIllegalStrings.ts | 44 +++++++++++++++++++ .../core/checkIllegalStrings/constant.ts | 15 +++++++ src/modules/core/index.ts | 1 + .../connection/list/list_item/list_item.ts | 12 +++++ src/modules/pages/maintain/forms/form.ts | 7 +++ 5 files changed, 79 insertions(+) create mode 100644 src/modules/core/checkIllegalStrings/checkIllegalStrings.ts create mode 100644 src/modules/core/checkIllegalStrings/constant.ts create mode 100644 src/modules/core/index.ts diff --git a/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts b/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts new file mode 100644 index 0000000..696d8fb --- /dev/null +++ b/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts @@ -0,0 +1,44 @@ +/* + https://work.fineres.com/browse/REPORT-91724 用于参数统一校验 + */ +import { ILLEGAL_STRINGS } from "./constant"; +export type CheckResult = { + legal: boolean, + errorMsg: string, +} +export const CHECK_CORRECT: CheckResult = { + legal: true, + errorMsg: "", +}; + +/** + * 检测非法字符,返回错误提示 + * @param value 要校验的字符串 + */ +export function checkIllegalStrings(value: string): CheckResult { + // 后端传入的校验开关,如果没传,那也默认开启 + const enabled = Dec.system.enableParameterVerify ?? true; + if (enabled) { + const illegalStringIndex = ILLEGAL_STRINGS.findIndex(s => value.includes(s)); + if (illegalStringIndex === -1) { + return CHECK_CORRECT; + } + + return { + legal: false, + errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${ILLEGAL_STRINGS[illegalStringIndex]}`, + }; + } + + return CHECK_CORRECT; +} + +export function checkIllegalStringsInWidgetAndShowError(widget: any) { + const value = widget.getValue(); + const result = checkIllegalStrings(value); + if (!result.legal) { + widget.showError(result.errorMsg); + } + + return result.legal; +} diff --git a/src/modules/core/checkIllegalStrings/constant.ts b/src/modules/core/checkIllegalStrings/constant.ts new file mode 100644 index 0000000..a034a3f --- /dev/null +++ b/src/modules/core/checkIllegalStrings/constant.ts @@ -0,0 +1,15 @@ +/** + * 参数检验的非法字符数组 + */ +export const ILLEGAL_STRINGS = [ + "\"", + "<", + ">", + "&", + "/script", + "javascript:", + "onblur", + "getRuntime", + "ProcessBuilder", + "java.lang.ProcessImpl", +]; diff --git a/src/modules/core/index.ts b/src/modules/core/index.ts new file mode 100644 index 0000000..efe056c --- /dev/null +++ b/src/modules/core/index.ts @@ -0,0 +1 @@ +export { checkIllegalStringsInWidgetAndShowError, checkIllegalStrings } from "./checkIllegalStrings/checkIllegalStrings" diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index 60736d3..e61114c 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -7,6 +7,7 @@ import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../ import { testConnection } from '../../../maintain/forms/form.server'; import { DownListCombo, Label, SignEditor } from '@fui/core'; import { ApiFactory } from '../../../../crud/apiFactory'; +import { checkIllegalStrings } from "@core/index"; const api = new ApiFactory().create(); @@ -89,6 +90,17 @@ export class ListItem extends BI.BasicButton { return; } + const result = checkIllegalStrings(newName); + if (!result.legal) { + BI.Msg.toast(result.errorMsg, { + level: 'error', + }); + this.store.setIsEdit(false, name); + this.nameLabel.setText(name); + this.nameEditor.setValue(name); + + return; + } this.store.changeName(name, newName).then(re => { this.store.setIsEdit(false, name); if (re.errorCode) { diff --git a/src/modules/pages/maintain/forms/form.ts b/src/modules/pages/maintain/forms/form.ts index 609b880..4039f81 100644 --- a/src/modules/pages/maintain/forms/form.ts +++ b/src/modules/pages/maintain/forms/form.ts @@ -8,6 +8,7 @@ import { ConnectionJDBC, Connection, ResultType } from 'src/modules/crud/crud.ty import { DEFAULT_JNDI_DATA, DEFAULT_JDBC_POOL, DATEBASE_FILTER_TYPE } from '@constants/constant'; import { getJdbcDatabaseType, getChartLength } from '../../../app.service'; import { NAME_MAX_LENGTH } from '../../../app.constant'; +import { checkIllegalStrings } from "@core/index"; @shortcut() @store(MaintainFormModel) @@ -209,6 +210,12 @@ export class MaintainForm extends BI.Widget { if (this.form.validation && !this.form.validation()) { return false; } + const result = checkIllegalStrings(value.connectionName); + if (!result.legal) { + this.setFromError(result.errorMsg); + + return false; + } return true; } From ae629c949614ee40b6231521463763ccf6074527 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 11 Apr 2023 14:39:07 +0800 Subject: [PATCH 02/12] =?UTF-8?q?REPORT-93513=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=95=BF=E6=96=87=E6=9C=AC=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/database/database.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/pages/database/database.ts b/src/modules/pages/database/database.ts index b955b64..f905765 100644 --- a/src/modules/pages/database/database.ts +++ b/src/modules/pages/database/database.ts @@ -147,20 +147,18 @@ export class Datebase extends BI.Widget { items: [ { el: { - type: BI.HTapeLayout.xtype, + type: BI.VerticalAdaptLayout.xtype, hgap: 20, invisible: true, items: [ { type: BI.Label.xtype, - width: 70, textAlign: 'left', text: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), }, { type: BI.MultiSelectItem.xtype, - width: 80, selected: this.model.isInternal, text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), @@ -173,7 +171,6 @@ export class Datebase extends BI.Widget { }, { type: BI.MultiSelectItem.xtype, - width: 80, selected: this.model.isPlugin, text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), From 93f297c6143b970f247c39f83cd96915843893eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Tue, 11 Apr 2023 15:43:53 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-93628=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E3=80=90=E5=B9=B3=E5=8F=B0=E8=A7=86=E8=A7=89=E9=80=82?= =?UTF-8?q?=E9=85=8D=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=A4=84=E7=9A=84=E8=A7=86=E8=A7=89=E5=B1=95=E7=A4=BA=20fix:?= =?UTF-8?q?=20=E5=85=B6=E5=AE=9E=E9=80=82=E9=85=8D6.0=E7=9A=84=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E4=B8=8D=E6=B6=89=E5=8F=8A=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E9=83=A8=E5=88=86=E3=80=82=20=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E4=B8=BB=E9=A3=8E=E6=A0=BC=E6=94=B9=E4=B8=BA=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86border-bottom=E9=A3=8E=E6=A0=BC=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E9=82=A3=E4=B9=88=E8=BF=99=E9=87=8C=E4=B9=9F=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=94=B9=E4=B8=80=E4=B8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 7db6718..5f88a0f 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -423,7 +423,7 @@ export class FormJdbc extends BI.Widget { { type: BI.Editor.xtype, $value: 'password', - cls: 'bi-border bi-border-radius', + cls: 'bi-border-bottom', width: EDITOR_WIDTH, height: EDITOR_HEIGHT, allowBlank: true, @@ -715,7 +715,7 @@ export class FormJdbc extends BI.Widget { { type: BI.Editor.xtype, $value: 'temporary-file-pieces-limit', - cls: 'bi-border bi-border-radius', + cls: 'bi-border-bottom', width: EDITOR_WIDTH, height: EDITOR_HEIGHT, allowBlank: true, @@ -735,7 +735,7 @@ export class FormJdbc extends BI.Widget { { type: BI.Editor.xtype, $value: 'temporary-file-size-limit', - cls: 'bi-border bi-border-radius', + cls: 'bi-border-bottom', width: EDITOR_WIDTH, height: EDITOR_HEIGHT, allowBlank: true, @@ -801,7 +801,7 @@ export class FormJdbc extends BI.Widget { { type: BI.Editor.xtype, $value: 'hdfs-connection-address', - cls: 'bi-border bi-border-radius', + cls: 'bi-border-bottom', width: EDITOR_WIDTH, height: EDITOR_HEIGHT, allowBlank: true, From 7e3dabb31659f4eee6c3d06982fdcc1f88bfd13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Tue, 11 Apr 2023 16:12:39 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-93627=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E3=80=90=E5=B9=B3=E5=8F=B0=E8=A7=86=E8=A7=89=E9=80=82?= =?UTF-8?q?=E9=85=8D=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E6=A8=A1=E5=BC=8F=E9=80=89=E6=8B=A9=E5=A4=84?= =?UTF-8?q?=E6=9C=89=E6=BB=9A=E5=8A=A8=E6=9D=A1=20fix:=20=E5=B9=B6?= =?UTF-8?q?=E9=9D=9E=E8=BF=99=E6=AC=A1=E8=BF=AD=E4=BB=A3=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=89=8D=E5=B0=B1=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=20=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E7=9A=84=E8=AE=BE=E7=BD=AE=E5=A4=A7=E5=B0=8F=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=8C=A4=E5=87=BA=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 5f88a0f..28aa75f 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -573,6 +573,7 @@ export class FormJdbc extends BI.Widget { forms: [ { type: BI.VerticalLayout.xtype, + height: 55, items: [ { type: BI.FloatLeftLayout.xtype, @@ -595,9 +596,9 @@ export class FormJdbc extends BI.Widget { }, { type: BI.TextValueCombo.xtype, + _tgap: 15, $value: 'schema', width: EDITOR_WIDTH, - tgap: 15, disabled: true, value: schema, items: schema ? [{ text: schema, value: schema }] : [], From 23b901b251afc5eaf5f8f12e7b08115c47d703fe Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 11 Apr 2023 17:32:58 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E9=A1=BA=E5=B8=A6=E5=A4=84=E7=90=86=E4=B8=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/test_status/tip_icon/tip_fail.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/components/test_status/tip_icon/tip_fail.ts b/src/modules/components/test_status/tip_icon/tip_fail.ts index f8a77f3..c943248 100644 --- a/src/modules/components/test_status/tip_icon/tip_fail.ts +++ b/src/modules/components/test_status/tip_icon/tip_fail.ts @@ -54,8 +54,7 @@ export class TipFail extends BI.Widget { }], }, { type: BI.Label.xtype, - height: 14, - bgap: 10, + _bgap: 10, text: tipText, ref:(_ref:Label)=>{ this.failText=_ref; @@ -63,12 +62,12 @@ export class TipFail extends BI.Widget { }, { type: BI.VerticalAdaptLayout.xtype, - hgap: 5, + _hgap: 12, items: [ { type: BI.Button.xtype, text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'), - level: 'ignore', + clear: true, ref: (_ref: Button) => { this.detailButton = _ref; }, @@ -79,8 +78,8 @@ export class TipFail extends BI.Widget { }, { type: BI.Button.xtype, + light: true, text: BI.i18nText('Dec-Dcm_Back'), - level: 'ignore', handler: () => { this.fireEvent(TipFail.EVENT_CLOSE); }, From b44835ef906bf44999f9a9d8c0b7c6bb539f9ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Wed, 12 Apr 2023 10:37:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-93628=20fix=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=8B=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/file_chooser/file_chooser.ts | 2 +- src/modules/components/file_upload/file_upload.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/components/file_chooser/file_chooser.ts b/src/modules/components/file_chooser/file_chooser.ts index 634cfdb..dc430d1 100644 --- a/src/modules/components/file_chooser/file_chooser.ts +++ b/src/modules/components/file_chooser/file_chooser.ts @@ -41,7 +41,7 @@ export class FileChooser extends BI.Widget { items: [ { type: BI.SignEditor.xtype, - cls: 'bi-border bi-focus-shadow', + cls: 'bi-border-bottom bi-focus-shadow', width, height: 22, watermark, diff --git a/src/modules/components/file_upload/file_upload.ts b/src/modules/components/file_upload/file_upload.ts index 01892c0..9a4f62f 100644 --- a/src/modules/components/file_upload/file_upload.ts +++ b/src/modules/components/file_upload/file_upload.ts @@ -59,7 +59,7 @@ export class FileUpload extends BI.Widget { items: [ { type: BI.SignEditor.xtype, - cls: 'bi-border bi-focus-shadow', + cls: 'bi-border-bottom bi-focus-shadow', width: 300, height: 22, watermark, @@ -144,9 +144,9 @@ export class FileUpload extends BI.Widget { this.fileModified = _ref; }, }] - + }], - + }, tgap: 14, lgap: 4, @@ -155,7 +155,7 @@ export class FileUpload extends BI.Widget { type: BI.IconButton.xtype, cls: "default-delete-font", handler: function () { - NProgress.set(0.0); + NProgress.set(0.0); self.xhr.abort(); self.store.setFileName(''); self.clearInfo(); From f89124a76dc9f847150d4d656d59c3d9daae0dae Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Thu, 13 Apr 2023 15:16:12 +0800 Subject: [PATCH 07/12] =?UTF-8?q?REPORT-93847=20fix=EF=BC=9A=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/test_status/tip_icon/tip_fail.ts | 2 +- src/modules/pages/connection/connection.ts | 1 - src/modules/title/title_database/title_datebase.ts | 5 +++-- src/modules/title/title_maintain/title_maintain.ts | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/components/test_status/tip_icon/tip_fail.ts b/src/modules/components/test_status/tip_icon/tip_fail.ts index c943248..576580e 100644 --- a/src/modules/components/test_status/tip_icon/tip_fail.ts +++ b/src/modules/components/test_status/tip_icon/tip_fail.ts @@ -62,7 +62,7 @@ export class TipFail extends BI.Widget { }, { type: BI.VerticalAdaptLayout.xtype, - _hgap: 12, + hgap: 12, items: [ { type: BI.Button.xtype, diff --git a/src/modules/pages/connection/connection.ts b/src/modules/pages/connection/connection.ts index 90f5ba1..881759d 100644 --- a/src/modules/pages/connection/connection.ts +++ b/src/modules/pages/connection/connection.ts @@ -143,7 +143,6 @@ export class Connection extends BI.Widget { }, }], }, - width: 90, }, ], }, diff --git a/src/modules/title/title_database/title_datebase.ts b/src/modules/title/title_database/title_datebase.ts index 1441d75..6541237 100644 --- a/src/modules/title/title_database/title_datebase.ts +++ b/src/modules/title/title_database/title_datebase.ts @@ -25,13 +25,13 @@ export class TitleDatabase extends BI.Widget { items: [{ type: BI.VerticalAdaptLayout.xtype, height: 40, - rgap: 5, + rgap: 16, items: [ { type: BI.Button.xtype, $value: 'title-database-cancel', text: BI.i18nText('BI-Basic_Cancel'), - level: 'ignore', + light: true, handler: () => { this.store.setPageIndex(PAGE_INDEX.CONNECTION); }, @@ -49,6 +49,7 @@ export class TitleDatabase extends BI.Widget { }, }, ], + _rgap: -16, }], }; } diff --git a/src/modules/title/title_maintain/title_maintain.ts b/src/modules/title/title_maintain/title_maintain.ts index 18fdc2c..9eed070 100644 --- a/src/modules/title/title_maintain/title_maintain.ts +++ b/src/modules/title/title_maintain/title_maintain.ts @@ -15,13 +15,13 @@ export class TitleMaintain extends BI.Widget { items: [{ type: BI.VerticalAdaptLayout.xtype, height: 40, - rgap: 5, + hgap: 16, items: [ { type: BI.Button.xtype, $value: 'title-maintain-cancel', text: BI.i18nText('BI-Basic_Cancel'), - level: 'ignore', + clear: true, handler: () => { this.store.setIsCopy(false); this.store.setPageIndex(PAGE_INDEX.CONNECTION); @@ -32,7 +32,7 @@ export class TitleMaintain extends BI.Widget { type: BI.Button.xtype, $value: 'title-maintain-connection-test', text: BI.i18nText('Dec-Dcm_Connection_Test'), - level: 'ignore', + light: true, handler: () => { this.store.setTestEvent(); }, @@ -47,6 +47,7 @@ export class TitleMaintain extends BI.Widget { }, }, ], + _hgap: -16, }], }; } From 18539944944b9ddb5b5e072b169803b8e5f0aa43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Tue, 18 Apr 2023 14:11:09 +0800 Subject: [PATCH 08/12] =?UTF-8?q?REPORT-91727=20=E5=AF=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=BE=93=E5=85=A5=E7=9A=84=E5=8F=82=E6=95=B0=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E7=BB=9F=E4=B8=80=E6=A0=A1=E9=AA=8C=20DCM=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E4=B9=9F=E8=A6=81=E6=94=B9=E4=B8=8B=20feat=EF=BC=9A?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=80=BB=E8=BE=91=E5=8F=98=E6=9B=B4=EF=BC=8C?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E5=85=B3=E9=94=AE=E5=AD=97=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E4=B8=8D=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkIllegalStrings.ts | 26 ++++++++++++------- .../core/checkIllegalStrings/constant.ts | 8 +++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts b/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts index 696d8fb..ddc4f99 100644 --- a/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts +++ b/src/modules/core/checkIllegalStrings/checkIllegalStrings.ts @@ -18,19 +18,27 @@ export const CHECK_CORRECT: CheckResult = { export function checkIllegalStrings(value: string): CheckResult { // 后端传入的校验开关,如果没传,那也默认开启 const enabled = Dec.system.enableParameterVerify ?? true; + let result = CHECK_CORRECT; if (enabled) { - const illegalStringIndex = ILLEGAL_STRINGS.findIndex(s => value.includes(s)); - if (illegalStringIndex === -1) { - return CHECK_CORRECT; - } + // 关键字不区分大小写 + ILLEGAL_STRINGS.every(s => { + const sIndex = value.toLowerCase().indexOf(s); + if (sIndex !== -1) { + result = { + legal: false, + errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${value.substr(sIndex, s.length)}`, + }; - return { - legal: false, - errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${ILLEGAL_STRINGS[illegalStringIndex]}`, - }; + return false; + } + + return true; + }); + + return result; } - return CHECK_CORRECT; + return result; } export function checkIllegalStringsInWidgetAndShowError(widget: any) { diff --git a/src/modules/core/checkIllegalStrings/constant.ts b/src/modules/core/checkIllegalStrings/constant.ts index a034a3f..351c185 100644 --- a/src/modules/core/checkIllegalStrings/constant.ts +++ b/src/modules/core/checkIllegalStrings/constant.ts @@ -1,5 +1,5 @@ /** - * 参数检验的非法字符数组 + * 参数检验的非法字符数组,由于不区分大小写,统一用小写 */ export const ILLEGAL_STRINGS = [ "\"", @@ -9,7 +9,7 @@ export const ILLEGAL_STRINGS = [ "/script", "javascript:", "onblur", - "getRuntime", - "ProcessBuilder", - "java.lang.ProcessImpl", + "getruntime", + "processbuilder", + "java.lang.processimpl", ]; From eb6b5e6cffc817f239857d0556c24017b0785ab4 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Sun, 23 Apr 2023 11:54:55 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-93097=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=A4=9A=E6=AC=A1=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/list/list_item/list_item.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index e61114c..6723947 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -222,8 +222,8 @@ export class ListItem extends BI.BasicButton { private testConnectionAction() { // 接口返回的内容是对称加密的,前端要先解密再用新加密传回去 - const connection = this.model.connections - .find(item => item.connectionName === this.options.name); + const connection = BI.cloneDeep(this.model.connections + .find(item => item.connectionName === this.options.name)); if (BI.isNull(connection)) return; From 60c5ecf23e108c779e01515e46788533d52adcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Mon, 24 Apr 2023 19:46:26 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-94752=E3=80=90=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=20fix=EF=BC=9A=20=E8=A7=86=E8=A7=89=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.ts | 9 ++++----- src/modules/title/title.ts | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/app.ts b/src/modules/app.ts index 5155f5b..d909040 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -38,7 +38,6 @@ export class App extends BI.Widget { { el: { type: Title.xtype, - cls: 'bi-border-bottom', listeners: [{ eventName: 'EVENT_CLICK_SETTING', action:() => { @@ -82,10 +81,10 @@ export class App extends BI.Widget { } }, }, - left: 10, - top: 10, - right: 10, - bottom: 10, + left: 0, + top: 0, + right: 0, + bottom: 0, }], }, ], diff --git a/src/modules/title/title.ts b/src/modules/title/title.ts index 687e2e8..28858fb 100644 --- a/src/modules/title/title.ts +++ b/src/modules/title/title.ts @@ -11,7 +11,7 @@ export class Title extends BI.Widget { static xtype = 'dec.dcm.title'; props = { - baseCls: 'bi-card', + baseCls: '', } tab: Tab; linearSegment: LinearSegment; From 2b1cea4686513774d3745ded363e6b95c8f885f5 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 25 Apr 2023 15:37:48 +0800 Subject: [PATCH 11/12] =?UTF-8?q?REPORT-94654=20fix=EF=BC=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=BC=82=E5=B8=B8=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/test_status/tip_icon/tip_fail.ts | 1 + src/modules/pages/maintain/maintain.ts | 2 +- src/modules/pages/setting/setting.ts | 3 ++- src/modules/title/title_maintain/title_maintain.ts | 5 +++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/components/test_status/tip_icon/tip_fail.ts b/src/modules/components/test_status/tip_icon/tip_fail.ts index 576580e..a12f157 100644 --- a/src/modules/components/test_status/tip_icon/tip_fail.ts +++ b/src/modules/components/test_status/tip_icon/tip_fail.ts @@ -88,6 +88,7 @@ export class TipFail extends BI.Widget { type: BI.Button.xtype, text: retryText, handler: () => { + this.store.setIsCollapse(false); this.fireEvent(TipFail.EVENT_RELOAD); }, }, diff --git a/src/modules/pages/maintain/maintain.ts b/src/modules/pages/maintain/maintain.ts index 28b47b9..1f6f221 100644 --- a/src/modules/pages/maintain/maintain.ts +++ b/src/modules/pages/maintain/maintain.ts @@ -28,7 +28,7 @@ export class Maintain extends BI.Widget { return { type: BI.VTapeLayout.xtype, - hgap: 5, + hgap: 16, items: [ { type: BI.VerticalAdaptLayout.xtype, diff --git a/src/modules/pages/setting/setting.ts b/src/modules/pages/setting/setting.ts index eaddc96..29d3166 100644 --- a/src/modules/pages/setting/setting.ts +++ b/src/modules/pages/setting/setting.ts @@ -44,11 +44,11 @@ export class TimeOutSetting extends BI.Widget { }, { type: 'bi.vertical', cls: 'bi-card', - hgap: 10, vgap: 10, items: [ { type: 'bi.vertical_adapt', + hgap: 16, cls: 'bi-border-bottom', height: 32, items: [{ @@ -61,6 +61,7 @@ export class TimeOutSetting extends BI.Widget { }, { type: 'bi.vertical_adapt', + hgap: 16, items: [{ type: 'dec.label.editor.item', text: BI.i18nText('Dec-Over_Time'), diff --git a/src/modules/title/title_maintain/title_maintain.ts b/src/modules/title/title_maintain/title_maintain.ts index 9eed070..b121cf1 100644 --- a/src/modules/title/title_maintain/title_maintain.ts +++ b/src/modules/title/title_maintain/title_maintain.ts @@ -15,13 +15,13 @@ export class TitleMaintain extends BI.Widget { items: [{ type: BI.VerticalAdaptLayout.xtype, height: 40, - hgap: 16, items: [ { type: BI.Button.xtype, $value: 'title-maintain-cancel', text: BI.i18nText('BI-Basic_Cancel'), clear: true, + _rgap: 16, handler: () => { this.store.setIsCopy(false); this.store.setPageIndex(PAGE_INDEX.CONNECTION); @@ -30,6 +30,7 @@ export class TitleMaintain extends BI.Widget { }, { type: BI.Button.xtype, + _rgap: 16, $value: 'title-maintain-connection-test', text: BI.i18nText('Dec-Dcm_Connection_Test'), light: true, @@ -39,6 +40,7 @@ export class TitleMaintain extends BI.Widget { }, { type: BI.Button.xtype, + _rgap: 16, $value: 'title-maintain-save', text: BI.i18nText('BI-Basic_Save'), handler: () => { @@ -47,7 +49,6 @@ export class TitleMaintain extends BI.Widget { }, }, ], - _hgap: -16, }], }; } From 06f1ea79a57dcb74d2c7adac4089f1dd790c53e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Tue, 25 Apr 2023 19:44:46 +0800 Subject: [PATCH 12/12] =?UTF-8?q?REPORT-94752=E3=80=90=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=20fix:=E4=BF=AE=E5=A4=8D=E8=A7=86=E8=A7=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index fa34f1f..7b698a0 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -703,7 +703,7 @@ export const DATA_BASE_TYPES = [ type: 'jdbc', hasSchema: true, kerberos: false, - }, + }, { text: 'TDSQL', databaseType: 'tdsql', @@ -837,7 +837,7 @@ export const DEFAULT_JDBC_POOL = { }; export const CONNECTION_LAYOUT = { - hgap: 5, + hgap: 10, vgap: 15, labelHeight: 24, }; @@ -878,4 +878,4 @@ export const YES_OR_NO = [ text: BI.i18nText('Dec-Basic_No'), value: 0, } -] \ No newline at end of file +]