From 6ae97d768948e197a89492239441feca04c1dbb9 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期一, 07 四月 2025 17:16:02 +0800
Subject: [PATCH] fix:bug修复
---
LifePayment/LifePayment.Host/appsettings.json | 8 ++++----
LifePayment/LifePayment.Application/User/UserRoleService.cs | 13 +++++++++++--
LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs | 13 +++++++++++--
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/LifePayment/LifePayment.Application/User/UserRoleService.cs b/LifePayment/LifePayment.Application/User/UserRoleService.cs
index 6a93332..decdddd 100644
--- a/LifePayment/LifePayment.Application/User/UserRoleService.cs
+++ b/LifePayment/LifePayment.Application/User/UserRoleService.cs
@@ -145,6 +145,7 @@
CheckExtensions.IfTrueThrowUserFriendlyException(result != Constant.SUCCESS,
CustomeErrorMessage.ResetPasswordFail);
}
+
public async Task<int> DeleteBackClientUser(Guid id)
{
var entity = await _userRepository.FirstOrDefaultAsync(s => s.Id == id && s.ClientId == Constant.ClientType.Back);
@@ -159,8 +160,16 @@
public async Task<Guid> CreateRole(CreateOrUpdateRoleInput input)
{
- var entity = ObjectMapper.Map<CreateOrUpdateRoleInput, Role>(input);
- return await _roleRepository.InsertAndGetIdAsync(entity);
+ Role role = new Role()
+ {
+ Id = input.Id,
+ Name = input.Name,
+ Sequence = input.Sequence,
+ DepartmentId = input.DepartmentId,
+ DataRange = input.DataRange,
+ Remark = input.Remark
+ };
+ return await _roleRepository.InsertAndGetIdAsync(role);
}
public async Task<PageOutput<RoleInfo>> GetRoles(GetRolesInput input)
diff --git a/LifePayment/LifePayment.Host/appsettings.json b/LifePayment/LifePayment.Host/appsettings.json
index 215c844..a6d581f 100644
--- a/LifePayment/LifePayment.Host/appsettings.json
+++ b/LifePayment/LifePayment.Host/appsettings.json
@@ -18,10 +18,10 @@
"OssRoleRan": "acs:ram::1483797030072898:role/boleoss"
},
"ConnectionStrings": {
- "AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole147258",
- "LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole147258"
- //"LifePaymentServices": "Server=47.99.94.254;port=3306;Database=Pro_LifePayment;Uid=ziqi;Pwd=Asdfk%$#258;",
- //"AbpIdentity": "Server=47.99.94.254;port=3306;Database=Pro_LifePaymentIdentity;Uid=ziqi;Pwd=Asdfk%$#258;"
+ //"AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole147258",
+ //"LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole147258"
+ "LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Pro_LifePayment;Uid=bole;Pwd=BLwsx123#@!;",
+ "AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Pro_LifePaymentIdentity;Uid=bole;Pwd=BLwsx123#@!;"
},
"App": {
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs b/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
index 2be205b..fd05e4d 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
@@ -1,7 +1,9 @@
锘縰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;
@@ -128,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;
}
--
Gitblit v1.10.0