Browse Source

添加租户模块

pull/10/head 4.4.0.7
王军 5 years ago
parent
commit
902557fd80
  1. 1
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/CompanyName.ProjectName.HttpApi.Host.csproj
  2. 13
      aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/CompanyName.ProjectName.IdentityServer.csproj
  3. 2
      aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/ILoginAppService.cs
  4. 6
      aspnet-core/services/src/CompanyName.ProjectName.Application/Users/LoginAppService.cs
  5. 6
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs
  6. 85
      vben271/src/services/ServiceProxies.ts
  7. 3
      vben271/src/views/identityServers/clients/ClientUri.vue

1
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/CompanyName.ProjectName.HttpApi.Host.csproj

@ -71,6 +71,7 @@
<_ContentIncludedByDefault Remove="publish\publish\publish\appsettings.secrets.json" />
<_ContentIncludedByDefault Remove="publish\publish\publish\CompanyName.ProjectName.HttpApi.Host.deps.json" />
<_ContentIncludedByDefault Remove="publish\publish\publish\CompanyName.ProjectName.HttpApi.Host.runtimeconfig.json" />
<_ContentIncludedByDefault Remove="publish\publish\publish\appsettings.Production.json" />
</ItemGroup>
</Project>

13
aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/CompanyName.ProjectName.IdentityServer.csproj

@ -48,4 +48,17 @@
<ProjectReference Include="..\..\src\CompanyName.ProjectName.EntityFrameworkCore.DbMigrations\CompanyName.ProjectName.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="publish\CompanyName.ProjectName.IdentityServer.dll.config" />
<_ContentIncludedByDefault Remove="publish\web.config" />
<_ContentIncludedByDefault Remove="publish\appsettings.Development.json" />
<_ContentIncludedByDefault Remove="publish\appsettings.json" />
<_ContentIncludedByDefault Remove="publish\appsettings.Production.json" />
<_ContentIncludedByDefault Remove="publish\appsettings.secrets.json" />
<_ContentIncludedByDefault Remove="publish\CompanyName.ProjectName.IdentityServer.deps.json" />
<_ContentIncludedByDefault Remove="publish\CompanyName.ProjectName.IdentityServer.runtimeconfig.json" />
<_ContentIncludedByDefault Remove="publish\package.json" />
<_ContentIncludedByDefault Remove="publish\wwwroot\libs\malihu-custom-scrollbar-plugin\package.json" />
</ItemGroup>
</Project>

2
aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/ILoginAppService.cs

@ -12,6 +12,6 @@ namespace CompanyName.ProjectName.Users
Task<LoginOutput> LoginAsync(LoginInput input);
Task<LoginOutput> StsLoginAsync(string accessToken);
Task LogoutAsync();
}
}

6
aspnet-core/services/src/CompanyName.ProjectName.Application/Users/LoginAppService.cs

@ -83,11 +83,7 @@ namespace CompanyName.ProjectName.Users
return await BuildResult(user);
}
public async Task LogoutAsync()
{
//await _contextAccessor.HttpContext.SignOutAsync(IdentityServerConstants.DefaultCookieAuthenticationScheme);
await _signInManager.SignOutAsync();
}
public async Task<LoginOutput> BuildResult(IdentityUser user)
{

6
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs

@ -28,11 +28,5 @@ namespace CompanyName.ProjectName.Controllers.Systems
{
return _loginAppService.StsLoginAsync(accessToken);
}
[SwaggerOperation(summary: "登出", Tags = new[] {"Account"})]
[HttpPost("/api/app/account/logout")]
public async Task LogoutAsync()
{
await _loginAppService.LogoutAsync();
}
}
}

85
vben271/src/services/ServiceProxies.ts

@ -1167,91 +1167,6 @@ export class AccountServiceProxy extends ServiceProxyBase {
}
return Promise.resolve<LoginOutput>(<any>null);
}
/**
*
* @return Success
*/
logout( cancelToken?: CancelToken | undefined): Promise<void> {
let url_ = this.baseUrl + "/api/app/account/logout";
url_ = url_.replace(/[?&]$/, "");
let options_ = <AxiosRequestConfig>{
method: "POST",
url: url_,
headers: {
},
cancelToken
};
return this.transformOptions(options_).then(transformedOptions_ => {
return this.instance.request(transformedOptions_);
}).catch((_error: any) => {
if (isAxiosError(_error) && _error.response) {
return _error.response;
} else {
throw _error;
}
}).then((_response: AxiosResponse) => {
return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processLogout(_response));
});
}
protected processLogout(response: AxiosResponse): Promise<void> {
const status = response.status;
let _headers: any = {};
if (response.headers && typeof response.headers === "object") {
for (let k in response.headers) {
if (response.headers.hasOwnProperty(k)) {
_headers[k] = response.headers[k];
}
}
}
if (status === 200) {
const _responseText = response.data;
return Promise.resolve<void>(<any>null);
} else if (status === 403) {
const _responseText = response.data;
let result403: any = null;
let resultData403 = _responseText;
result403 = RemoteServiceErrorResponse.fromJS(resultData403);
return throwException("Forbidden", status, _responseText, _headers, result403);
} else if (status === 401) {
const _responseText = response.data;
let result401: any = null;
let resultData401 = _responseText;
result401 = RemoteServiceErrorResponse.fromJS(resultData401);
return throwException("Unauthorized", status, _responseText, _headers, result401);
} else if (status === 400) {
const _responseText = response.data;
let result400: any = null;
let resultData400 = _responseText;
result400 = RemoteServiceErrorResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);
} else if (status === 404) {
const _responseText = response.data;
let result404: any = null;
let resultData404 = _responseText;
result404 = RemoteServiceErrorResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);
} else if (status === 501) {
const _responseText = response.data;
let result501: any = null;
let resultData501 = _responseText;
result501 = RemoteServiceErrorResponse.fromJS(resultData501);
return throwException("Server Error", status, _responseText, _headers, result501);
} else if (status === 500) {
const _responseText = response.data;
let result500: any = null;
let resultData500 = _responseText;
result500 = RemoteServiceErrorResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);
} else if (status !== 200 && status !== 204) {
const _responseText = response.data;
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}
return Promise.resolve<void>(<any>null);
}
}
export class ApiResourceServiceProxy extends ServiceProxyBase {

3
vben271/src/views/identityServers/clients/ClientUri.vue

@ -36,7 +36,7 @@
/>
<a-button
type="primary"
@click="handleRemoveLogoutRedirectUri(item.postLogoutRedirectUris)"
@click="handleRemoveLogoutRedirectUri(item.postLogoutRedirectUri)"
danger
>{{ t('common.delText') }}</a-button
>
@ -122,6 +122,7 @@
};
const handleRemoveLogoutRedirectUri = async (redirectUri: string) => {
debugger;
await removeLogoutRedirectUriAsync({
clientId: state.currentClient.clientId,
uri: redirectUri,

Loading…
Cancel
Save