mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-04-07 17:41:28 +08:00
ru
This commit is contained in:
@@ -86,6 +86,9 @@
|
||||
<Compile Include="Extention\WF_Runtime.cs" />
|
||||
<Compile Include="Extention\WF_RuntimeInitModel.cs" />
|
||||
<Compile Include="Extention\WF_RuntimeModel.cs" />
|
||||
<Compile Include="Request\IdPageReq.cs" />
|
||||
<Compile Include="Request\PageReq.cs" />
|
||||
<Compile Include="Request\QueryUserListReq.cs" />
|
||||
<Compile Include="WFFormService.cs" />
|
||||
<Compile Include="WFProcessInstanceService.cs" />
|
||||
<Compile Include="WFSchemeService.cs" />
|
||||
@@ -128,7 +131,9 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="Response\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
7
OpenAuth.App/Request/IdPageReq.cs
Normal file
7
OpenAuth.App/Request/IdPageReq.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace OpenAuth.App.Request
|
||||
{
|
||||
public class IdPageReq :PageReq
|
||||
{
|
||||
public string id { get; set; }
|
||||
}
|
||||
}
|
||||
16
OpenAuth.App/Request/PageReq.cs
Normal file
16
OpenAuth.App/Request/PageReq.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace OpenAuth.App.Request
|
||||
{
|
||||
public class PageReq
|
||||
{
|
||||
public int page { get; set; }
|
||||
public int limit { get; set; }
|
||||
|
||||
public string key { get; set; }
|
||||
|
||||
public PageReq()
|
||||
{
|
||||
page = 1;
|
||||
limit = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
7
OpenAuth.App/Request/QueryUserListReq.cs
Normal file
7
OpenAuth.App/Request/QueryUserListReq.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace OpenAuth.App.Request
|
||||
{
|
||||
public class QueryUserListReq : PageReq
|
||||
{
|
||||
public string orgId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace OpenAuth.App.SSO
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><>½<EFBFBD>ӿ<EFBFBD>
|
||||
/// <20><>¼<EFBFBD>ӿ<EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="appKey">Ӧ<>ó<EFBFBD><C3B3><EFBFBD>key.</param>
|
||||
/// <param name="username"><3E>û<EFBFBD><C3BB><EFBFBD></param>
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Web.Mvc;
|
||||
namespace OpenAuth.App.SSO
|
||||
{
|
||||
/// <summary>
|
||||
/// 采用Attribute的方式验证登陆
|
||||
/// 采用Attribute的方式验证登录
|
||||
/// <para>李玉宝新增于2016-11-09 10:08:10</para>
|
||||
/// </summary>
|
||||
public class SSOAuthAttribute : ActionFilterAttribute
|
||||
|
||||
@@ -4,6 +4,7 @@ using OpenAuth.Domain.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenAuth.App.Request;
|
||||
|
||||
|
||||
namespace OpenAuth.App
|
||||
@@ -43,20 +44,20 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部用户
|
||||
/// </summary>
|
||||
public GridData Load(string orgId, int pageindex, int pagesize)
|
||||
public GridData Load(QueryUserListReq request)
|
||||
{
|
||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
if (request.page < 1) request.page = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
IEnumerable<User> users;
|
||||
int records = 0;
|
||||
if (orgId ==string.Empty)
|
||||
if (request.orgId ==string.Empty)
|
||||
{
|
||||
users = _repository.LoadUsers(pageindex, pagesize);
|
||||
users = _repository.LoadUsers(request.page, request.limit);
|
||||
records = _repository.GetCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
var ids = GetSubOrgIds(orgId);
|
||||
users = _repository.LoadInOrgs(pageindex, pagesize, ids);
|
||||
var ids = GetSubOrgIds(request.orgId);
|
||||
users = _repository.LoadInOrgs(request.page, request.limit, ids);
|
||||
records = _repository.GetUserCntInOrgs(ids);
|
||||
}
|
||||
var userviews = new List<UserView>();
|
||||
@@ -72,9 +73,9 @@ namespace OpenAuth.App
|
||||
return new GridData
|
||||
{
|
||||
count = records,
|
||||
total = (int)Math.Ceiling((double)records / pagesize),
|
||||
total = (int)Math.Ceiling((double)records / request.limit),
|
||||
data = userviews,
|
||||
page = pageindex
|
||||
page = request.page
|
||||
};
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ namespace OpenAuth.App
|
||||
if (string.IsNullOrEmpty(view.OrganizationIds))
|
||||
throw new Exception("请为用户分配机构");
|
||||
User user = view;
|
||||
if (user.Id == string.Empty)
|
||||
if (string.IsNullOrEmpty(view.Id))
|
||||
{
|
||||
if (_repository.IsExist(u => u.Account == view.Account))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user