Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc38374f

Browse files
committed
1添加功能
1 parent8a730f8 commitc38374f

File tree

12 files changed

+84
-16
lines changed

12 files changed

+84
-16
lines changed

‎src/Destiny.Core.Flow.API/Controllers/AssetController.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
namespaceDestiny.Core.Flow.API.Controllers
1414
{
15-
[Description("资产控制器")]
15+
16+
/// <summary>
17+
/// 资产管理
18+
/// </summary>
19+
[Description("资产管理")]
1620

1721
publicclassAssetController:CrudAdminControllerBase<IAssetService,Guid,Asset,AssetInputDto,AssetOutputDto,AssetPageListDto>
1822
{

‎src/Destiny.Core.Flow.API/Controllers/IdentityController.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public async Task<AjaxResult> LoginAsync([FromBody] LoginDto loginDto)
5555
/// <returns></returns>
5656
[HttpPost]
5757
[Description("更改密码")]
58-
[NoAuthorityVerification]
5958
publicasyncTask<AjaxResult>ChangePassword([FromBody]ChangePassInputDtodto)
6059
{
6160

‎src/Destiny.Core.Flow.API/Controllers/UserController.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ public async Task<AjaxResult> GetUsersAsync()
148148
{
149149

150150
return(await_userService.GetUsersAsync()).ToAjaxResult();
151+
}
152+
153+
/// <summary>
154+
/// 异步重置密码
155+
/// </summary>
156+
/// <param name="userId">用户ID</param>
157+
/// <returns></returns>
158+
[HttpGet]
159+
[Description("异步重置密码")]
160+
publicTask<AjaxResult>ResetPasswordAsync(GuiduserId)
161+
{
162+
return_userService.ResetPasswordAsync(userId).ToAjaxResult();
151163
}
152164
}
153165
}

‎src/Destiny.Core.Flow.API/Destiny.Core.Flow.API.xml‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/Destiny.Core.Flow.API/Startup.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public Startup(IConfiguration configuration)
2525
// This method gets called by the runtime. Use this method to add services to the container.
2626
publicvoidConfigureServices(IServiceCollectionservices)
2727
{
28-
2928
services.AddApplication<AppWebModule>();
3029
}
3130
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

‎src/Destiny.Core.Flow.AspNetCore/CrudAdminControllerBaseOfModle.cs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ public abstract class CrudAdminControllerBase<ICrudService, TPrimaryKey, TEntity
176176
whereICrudService:ICrudServiceAsync<TPrimaryKey,TEntity,IInputDto,IIOutputDto,IPagedListDto>
177177
{
178178

179-
180-
181179
protectedCrudAdminControllerBase(ICrudServicecrudServiceAsync):base(crudServiceAsync)
182180
{
183181

‎src/Destiny.Core.Flow.AuthenticationCenter/Views/Account/Login.cshtml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<divclass="sub-main-w3">
66
<formasp-route="Login">
77
<h2>
8-
欢迎使用DestinyCore系统
8+
欢迎使用星睿系统
99
</h2>
1010
<inputtype="hidden"asp-for="ReturnUrl" />
1111
<divclass="form-style-agile">

‎src/Destiny.Core.Flow.AuthenticationCenter/Views/Shared/_Layout.cshtml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@*<partial name="_Nav" />*@
2222
@RenderBody()
2323
<divclass="footer">
24-
<a>版权所有 DestinyCore</a>
24+
<a>版权所有 星睿开发团队</a>
2525
</div>
2626

2727
@*<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>*@

‎src/Destiny.Core.Flow.IServices/Users/IUserServices.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,12 @@ public interface IUserServices : IScopedDependency
6666
/// </summary>
6767
/// <returns></returns>
6868
Task<OperationResponse<IEnumerable<SelectListItem>>>GetUsersToSelectListItemAsync();
69+
70+
/// <summary>
71+
/// 重置密码
72+
/// </summary>
73+
/// <param name="userId">用户ID</param>
74+
/// <returns></returns>
75+
Task<OperationResponse>ResetPasswordAsync(GuiduserId);
6976
}
7077
}

‎src/Destiny.Core.Flow.Services/Users/UserServices.cs‎

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public async Task<OperationResponse> DeleteAsync(Guid id)
117117
if(user.NormalizedUserName=="ADMIN")
118118
{
119119
returnOperationResponse.Error("此用户为系统超级管理员,无法删除");
120-
}
121-
122-
// IList<string> existRoleNames = await _userManager.GetRolesAsync(user);
120+
}
121+
122+
// IList<string> existRoleNames = await _userManager.GetRolesAsync(user);
123123
returnawait_unitOfWork.UseTranAsync(async()=>
124124
{
125125
varresult=await_userManager.DeleteAsync(user);
@@ -152,8 +152,8 @@ public async Task<OperationResponse> UpdateAsync(UserUpdateInputDto dto)
152152
varuser=await_userManager.FindByIdAsync(dto.Id.ToString());
153153
user=dto.MapTo(user);
154154
varresult=await_userManager.UpdateAsync(user);
155-
returnresult.ToOperationResponse("保存用户成功");
156-
155+
returnresult.ToOperationResponse("保存用户成功");
156+
157157
}
158158

159159
/// <summary>
@@ -228,6 +228,30 @@ public async Task<OperationResponse<IEnumerable<SelectListItem>>> GetUsersToSele
228228
Selected=false,
229229
}).ToListAsync();
230230
returnnewOperationResponse<IEnumerable<SelectListItem>>("得到数据成功",users,OperationResponseType.Success);
231-
}
231+
}
232+
233+
/// <summary>
234+
/// 重置密码
235+
/// </summary>
236+
/// <param name="userId"></param>
237+
/// <returns></returns>
238+
publicasyncTask<OperationResponse>ResetPasswordAsync(GuiduserId)
239+
{
240+
userId.NotEmpty(nameof(userId));
241+
//是否超级用户
242+
varisSuperUser=_principal.Identity.GetUserName("name")?.Equals("Admin",StringComparison.OrdinalIgnoreCase);
243+
if(isSuperUser==false)
244+
{
245+
returnOperationResponse.Error("不是超过用户无法重置密码");
246+
}
247+
varpassword="123456";
248+
varuser=await_userManager.FindByIdAsync(userId.AsTo<string>());
249+
//重置此用户令牌
250+
vartoken=await_userManager.GeneratePasswordResetTokenAsync(user);
251+
//更新密码 123456 系统默认超级密码
252+
varresult=await_userManager.ResetPasswordAsync(user,token,password);
253+
returnresult.ToOperationResponse($"重置密码成功,密码为【{password}】");
254+
255+
}
232256
}
233257
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp