Browse Source

Merge pull request #13783 from abpframework/auto-merge/rel-6-0/1298

Merge branch dev with rel-6.0
pull/13095/head
liangshiwei 4 years ago
committed by GitHub
parent
commit
40fda190e3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      docs/en/UI/Angular/Current-User.md
  2. 4
      docs/en/docs-nav.json
  3. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs

20
docs/en/UI/Angular/Current-User.md

@ -0,0 +1,20 @@
# Angular UI: Current User
The current user information stored in Config State.
### How to Get a Current User Information Configuration
You can use the `getOne` or `getOne$` method of `ConfigStateService` to get a specific configuration property. For that, the property name should be passed to the method as parameter.
```js
// this.config is an instance of ConfigStateService
const currentUser = this.config.getOne("currentUser");
// or
this.config.getOne$("currentUser").subscribe(currentUser => {
// use currentUser here
})
```
> See the [ConfigStateService](./Config-State-Service) for more information.

4
docs/en/docs-nav.json

@ -981,6 +981,10 @@
"text": "Authorization",
"path": "UI/Angular/Authorization.md"
},
{
"text": "Current User",
"path": "UI/Angular/Current-User.md"
},
{
"text": "HTTP Requests",
"path": "UI/Angular/HTTP-Requests.md"

2
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs

@ -19,7 +19,7 @@ public class UserInfoController : AbpOpenIdDictControllerBase
[HttpGet]
[HttpPost]
[Produces("application/json")]
public async Task<IActionResult> Userinfo()
public virtual async Task<IActionResult> Userinfo()
{
var user = await UserManager.GetUserAsync(User);
if (user == null)

Loading…
Cancel
Save