From bf2d06ee46b254097c1d205c2ce37ab15a4ad91b Mon Sep 17 00:00:00 2001
From: lingling <kety1122@163.com>
Date: 星期三, 16 四月 2025 14:20:51 +0800
Subject: [PATCH] fix bug

---
 LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs b/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
index aec1d39..fd05e4d 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
@@ -1,8 +1,11 @@
 锘縰sing LifePayment.Application.Contracts;
 using LifePayment.Domain.Shared;
 using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Identity;
 using Microsoft.AspNetCore.Mvc;
+using Nest;
 using System;
+using System.Collections.Generic;
 using System.Threading.Tasks;
 using Volo.Abp.AspNetCore.Mvc;
 using Volo.Abp.Identity;
@@ -40,6 +43,8 @@
         [HttpPost]
         public async Task<Guid> CreateBackClientUser(CreateBackClientUserInput input)
         {
+
+
             return await _accountService.CreateAccount(ObjectMapper.Map<CreateBackClientUserInput, CreateAccountInput>(input), isAdminCreate: true);
         }
 
@@ -62,6 +67,11 @@
         [HttpPost]
         public async Task<int> UpdateBackClientUser(UpdateBackClientUserInput input)
         {
+
+            var identityUser = await _identityUserService.GetAsync(input.Id);
+
+            CheckExtensions.IfTrueThrowUserFriendlyException(identityUser == null,
+                                                             "鐢ㄦ埛涓嶅瓨鍦�");
             await _identityUserService.UpdateAsync(input.Id, new IdentityUserUpdateDto
             {
                 Name = input.Name,
@@ -70,6 +80,19 @@
                 RoleNames = input.RoleNames,
             });
             return await _userRoleService.UpdateBackClientUser(input);
+        }
+
+        /// <summary>
+        /// 閲嶇疆瀵嗙爜
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public virtual async Task<int> ResetUserPassword(ResetPasswordBaseInput input)
+        {
+            await _userRoleService.ResetPassword(input);
+
+            return Constant.SUCCESS;
         }
 
         /// <summary>
@@ -107,8 +130,15 @@
                 Sequence = input.Sequence,
                 Note = input.Remark,
             });
-            var newInput = ObjectMapper.Map<CreateBaseRoleInput, CreateOrUpdateRoleInput>(input);
-            newInput.Id = res.Id;
+            CreateOrUpdateRoleInput newInput = new CreateOrUpdateRoleInput()
+            {
+                Id = res.Id,
+                Name = input.Name,
+                Sequence = input.Sequence,
+                DepartmentId = input.DepartmentId,
+                DataRange = input.DataRange,
+                Remark = input.Remark,
+            };
             await _userRoleService.CreateRole(newInput);
             return res.Id;
         }
@@ -179,5 +209,15 @@
             await _identityRoleService.DeleteAsync(id);
             return await _userRoleService.DeleteRole(id);
         }
+
+        /// <summary>
+        /// 鑾峰彇鐢ㄦ埛璐﹀彿璇︽儏
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        public async Task<BackClientUserInfoOutput> GetBackClientUserInfo()
+        {
+            return await _accountService.GetBackClientUserInfo();
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1