From 0a4648decb643a53c223c63da551349d91493356 Mon Sep 17 00:00:00 2001 From: congqiu Date: Tue, 2 Jun 2020 19:13:07 +0800 Subject: [PATCH] =?UTF-8?q?DEC-13518=20fix:=20=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E9=AB=98=E7=BA=A7=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E4=BF=AE=E6=94=B9=E2=80=9C=E5=BC=80=E5=90=AF=E7=A9=BA?= =?UTF-8?q?=E9=97=B2=E5=9B=9E=E6=94=B6=E5=99=A8=E6=A3=80=E9=AA=8C=E2=80=9D?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/api.ts | 5 +++++ src/modules/crud/decision.api.ts | 4 ++++ src/modules/crud/design.api.ts | 5 +++++ src/modules/pages/maintain/forms/components/form.jdbc.ts | 7 +++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/modules/crud/api.ts b/src/modules/crud/api.ts index bdc44a6..c29aa3e 100644 --- a/src/modules/crud/api.ts +++ b/src/modules/crud/api.ts @@ -61,4 +61,9 @@ export interface Api { * 判断是否是驱动的错误 */ isDriverError(errorCode: string): boolean; + + /** + * 获取加密后文本 + */ + getCipher(password: string): string; } diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index d046519..3c51680 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -93,6 +93,10 @@ export class DecisionApi implements Api { return false; } + getCipher(password: string) { + return BI.Providers.getProvider('dec.provider.cipher').getCipher(password); + } + private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { diff --git a/src/modules/crud/design.api.ts b/src/modules/crud/design.api.ts index a551e36..f7863e6 100644 --- a/src/modules/crud/design.api.ts +++ b/src/modules/crud/design.api.ts @@ -66,4 +66,9 @@ export class DesignApi implements Api { // 设计器暂不校验 return false; } + + getCipher(password: string) { + // 设计器加密方法 + return password; + } } diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 3af4cf6..22752cd 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -7,6 +7,9 @@ import { connectionType } from '@constants/env'; import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; +import { ApiFactory } from 'src/modules/crud/apiFactory'; +const api = new ApiFactory().create(); + export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; @shortcut(FormJdbcXtype) export class FormJdbc extends BI.Widget { @@ -742,7 +745,7 @@ export class FormJdbc extends BI.Widget { driver: this.form.driver.getValue(), url: this.form.url.getValue(), user: this.form.user.getValue(), - password: this.oldPassword === this.form.password.getValue() ? this.oldPassword : BI.Providers.getProvider('dec.provider.cipher').getCipher(this.form.password.getValue()), + password: this.oldPassword === this.form.password.getValue() ? this.oldPassword : api.getCipher(this.form.password.getValue()), queryType: '', newCharsetName: originalCharsetName ? 'gbk' : '', // 后台要求,originalCharsetName不为空时,newCharsetName为gbk originalCharsetName, @@ -761,7 +764,7 @@ export class FormJdbc extends BI.Widget { validationQuery: this.form.validationQuery.getValue(), testOnBorrow: BI.size(this.form.testOnBorrow.getValue()) > 0 ? this.form.testOnBorrow.getValue()[0] : connectionPoolAttr.testOnBorrow, testOnReturn: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testOnReturn.getValue()[0] : connectionPoolAttr.testOnReturn, - testWhileIdle: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testWhileIdle.getValue()[0] : connectionPoolAttr.testWhileIdle, + testWhileIdle: BI.size(this.form.testWhileIdle.getValue()) > 0 ? this.form.testWhileIdle.getValue()[0] : connectionPoolAttr.testWhileIdle, timeBetweenEvictionRunsMillis: this.form.timeBetweenEvictionRunsMillis.getValue(), numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(),