From 2c5ba60d15d220a33f1702d924085f131cd2210a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 9 Sep 2022 17:47:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=88=87=E6=8D=A2?= =?UTF-8?q?tab=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/app.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/pages/app.component.ts b/src/app/pages/app.component.ts index 0375bd6c..f7af028f 100644 --- a/src/app/pages/app.component.ts +++ b/src/app/pages/app.component.ts @@ -12,7 +12,8 @@ export class AppComponent { public viewSrv: ViewService ) {} @HostListener('window:keydown', ['$event']) - onKeyPress($event: KeyboardEvent) { + onKeyDown($event: KeyboardEvent) { + $event.stopPropagation(); const condition = this.viewSrv.viewList.length > 1 && $event.shiftKey; if (condition && $event.keyCode === 37) { this.viewSrv.switchView('left'); From c3886b98699ce524de5b6f5829feb7eae23ae34b Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 13 Sep 2022 11:01:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8A=A0=E5=AF=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89key=E5=B0=B1=E4=B8=8D=E5=8A=A0=E5=AF=86=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/utils/crypto.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/utils/crypto.ts b/src/app/utils/crypto.ts index 2e3e8210..faab611a 100644 --- a/src/app/utils/crypto.ts +++ b/src/app/utils/crypto.ts @@ -60,7 +60,11 @@ export function encryptPassword(password) { } const aesKey = (Math.random() + 1).toString(36).substring(2); // public key 是 base64 存储的 - const rsaPublicKeyText = getCookie('jms_public_key') + let rsaPublicKeyText = getCookie('jms_public_key'); + if (!rsaPublicKeyText) { + return password; + } + rsaPublicKeyText = rsaPublicKeyText .replace('"', '') .replace('"', ''); const rsaPublicKey = atob(rsaPublicKeyText); From 71f72e5644f106ef026f6f50c55c91152e76c8d7 Mon Sep 17 00:00:00 2001 From: huailei <31801270+huailei000@users.noreply.github.com> Date: Tue, 13 Sep 2022 13:06:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Revert=20"fix:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=88=87=E6=8D=A2tab=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E6=96=B9=E6=B3=95"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2c5ba60d15d220a33f1702d924085f131cd2210a. --- src/app/pages/app.component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/pages/app.component.ts b/src/app/pages/app.component.ts index f7af028f..0375bd6c 100644 --- a/src/app/pages/app.component.ts +++ b/src/app/pages/app.component.ts @@ -12,8 +12,7 @@ export class AppComponent { public viewSrv: ViewService ) {} @HostListener('window:keydown', ['$event']) - onKeyDown($event: KeyboardEvent) { - $event.stopPropagation(); + onKeyPress($event: KeyboardEvent) { const condition = this.viewSrv.viewList.length > 1 && $event.shiftKey; if (condition && $event.keyCode === 37) { this.viewSrv.switchView('left'); From f65058f17e56fb4142918624db2d45321d90bf9d Mon Sep 17 00:00:00 2001 From: huailei <31801270+huailei000@users.noreply.github.com> Date: Tue, 13 Sep 2022 14:56:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?Revert=20"feat:=20=E5=A2=9E=E5=8A=A0shift+?= =?UTF-8?q?=E5=B7=A6/=E5=8F=B3=E9=94=AE=E7=9B=98=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=88=87=E6=8D=A2tabs"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c9c521953e222785564b546e0a796aa755b845fc. --- src/app/pages/app.component.ts | 17 +++-------------- src/app/services/view.ts | 20 -------------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/app/pages/app.component.ts b/src/app/pages/app.component.ts index 0375bd6c..5c4d6f45 100644 --- a/src/app/pages/app.component.ts +++ b/src/app/pages/app.component.ts @@ -1,5 +1,5 @@ -import {Component, HostListener} from '@angular/core'; -import {I18nService, ViewService} from '@app/services'; +import {Component} from '@angular/core'; +import {I18nService} from '@app/services'; @Component({ selector: 'app-root', @@ -8,18 +8,7 @@ import {I18nService, ViewService} from '@app/services'; }) export class AppComponent { - constructor(_i18n: I18nService, - public viewSrv: ViewService - ) {} - @HostListener('window:keydown', ['$event']) - onKeyPress($event: KeyboardEvent) { - const condition = this.viewSrv.viewList.length > 1 && $event.shiftKey; - if (condition && $event.keyCode === 37) { - this.viewSrv.switchView('left'); - } - if (condition && $event.keyCode === 39) { - this.viewSrv.switchView('right'); - } + constructor(_i18n: I18nService) { } } diff --git a/src/app/services/view.ts b/src/app/services/view.ts index f95a13a0..1939e48e 100644 --- a/src/app/services/view.ts +++ b/src/app/services/view.ts @@ -40,24 +40,4 @@ export class ViewService { const index = this.viewList.indexOf(view); this.viewList.splice(index, 1); } - - switchView(direction: ('left' | 'right')) { - const viewList = this.viewList; - const viewListLength = viewList.length; - for (let i = 0; i < viewListLength; i++) { - const current: View = viewList[i]; - if (current.id === this.currentView.id) { - let nextView: View, nextViewLength: number; - const next: number = direction === 'left' ? i - 1 : i + 1; - if (direction === 'left') { - nextViewLength = next < 0 ? viewListLength - 1 : next; - } else { - nextViewLength = next >= viewListLength ? 0 : next; - } - nextView = viewList[nextViewLength]; - if (nextView) { this.activeView(nextView); } - break; - } - } - } }