Browse Source
Merge pull request #22116 from abpframework/auto-merge/rel-9-1/3468
Merge branch dev with rel-9.1
pull/22128/head
maliming
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
3 deletions
-
common.props
-
npm/ng-packs/packages/core/src/lib/services/local-storage-listener.service.ts
|
|
|
@ -1,8 +1,13 @@ |
|
|
|
<Project> |
|
|
|
<PropertyGroup> |
|
|
|
<LangVersion>latest</LangVersion> |
|
|
|
<<<<<<< auto-merge/rel-9-1/3468 |
|
|
|
<Version>9.1.0-rc.2</Version> |
|
|
|
<LeptonXVersion>4.1.0-rc.2</LeptonXVersion> |
|
|
|
======= |
|
|
|
<Version>9.2.0-preview</Version> |
|
|
|
<LeptonXVersion>4.2.0-preview</LeptonXVersion> |
|
|
|
>>>>>>> dev |
|
|
|
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn> |
|
|
|
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl> |
|
|
|
<PackageProjectUrl>https://abp.io/</PackageProjectUrl> |
|
|
|
|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
import { DOCUMENT } from '@angular/common'; |
|
|
|
import { Injectable, inject } from '@angular/core'; |
|
|
|
|
|
|
|
@Injectable({ |
|
|
|
providedIn: 'root', |
|
|
|
}) |
|
|
|
@ -9,8 +8,13 @@ export class LocalStorageListenerService { |
|
|
|
|
|
|
|
constructor() { |
|
|
|
this.window.addEventListener('storage', event => { |
|
|
|
if (event.key === 'access_token' && event.newValue === null) { |
|
|
|
this.window.location.reload(); |
|
|
|
if (event.key === 'access_token') { |
|
|
|
const tokenRemoved = event.newValue === null; |
|
|
|
const tokenAdded = event.oldValue === null && event.newValue !== null; |
|
|
|
|
|
|
|
if (tokenRemoved || tokenAdded) { |
|
|
|
this.window.location.assign('/'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|