Merge branch 'abp' of https://gitee.com/ccnetcore/Yi into abp
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Yi.Framework.Rbac.Application.Services.Authentication
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="UserFriendlyException"></exception>
|
/// <exception cref="UserFriendlyException"></exception>
|
||||||
[HttpGet("auth/oauth/login/{scheme}")]
|
[HttpGet("auth/oauth/login/{scheme}")]
|
||||||
public async Task<string> AuthOauthLoginAsync([FromRoute] string scheme, [FromQuery] string code)
|
public async Task<object> AuthOauthLoginAsync([FromRoute] string scheme, [FromQuery] string code)
|
||||||
{
|
{
|
||||||
(var openId, var _) = await GetOpenIdAndNameAsync(scheme);
|
(var openId, var _) = await GetOpenIdAndNameAsync(scheme);
|
||||||
var authEntity = await _repository.GetAsync(x => x.OpenId == openId && x.AuthType == scheme);
|
var authEntity = await _repository.GetAsync(x => x.OpenId == openId && x.AuthType == scheme);
|
||||||
@@ -50,7 +50,7 @@ namespace Yi.Framework.Rbac.Application.Services.Authentication
|
|||||||
throw new UserFriendlyException("第三方登录失败,请先注册后,在个人中心进行绑定该第三方后使用");
|
throw new UserFriendlyException("第三方登录失败,请先注册后,在个人中心进行绑定该第三方后使用");
|
||||||
}
|
}
|
||||||
var accessToken = await _accountManager.GetTokenByUserIdAsync(authEntity.UserId);
|
var accessToken = await _accountManager.GetTokenByUserIdAsync(authEntity.UserId);
|
||||||
return accessToken;
|
return new { token= accessToken };
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user