From d1108700e0ad43b6bfea3f9a79bbb14799a2d29c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Tue, 15 Aug 2023 09:39:11 +0800
Subject: [PATCH] =?UTF-8?q?:zap:=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=BF=94=E5=9B=9E=E5=AE=9E=E4=BD=93=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Admin.WebApi/Controllers/System/SysUserController.cs | 3 ++-
ZR.Service/System/IService/ISysUserService.cs | 2 +-
ZR.Service/System/SysUserService.cs | 8 +++-----
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs
index 78b8c81..5a7bde3 100644
--- a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs
+++ b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs
@@ -93,9 +93,10 @@ namespace ZR.Admin.WebApi.Controllers.System
}
user.Create_by = HttpContext.GetName();
+ user.Create_time = DateTime.Now;
user.Password = NETCore.Encrypt.EncryptProvider.Md5(user.Password);
- return ToResponse(UserService.InsertUser(user));
+ return SUCCESS(UserService.InsertUser(user));
}
///
diff --git a/ZR.Service/System/IService/ISysUserService.cs b/ZR.Service/System/IService/ISysUserService.cs
index eb463fb..75feef1 100644
--- a/ZR.Service/System/IService/ISysUserService.cs
+++ b/ZR.Service/System/IService/ISysUserService.cs
@@ -28,7 +28,7 @@ namespace ZR.Service.System.IService
///
///
///
- public long InsertUser(SysUser sysUser);
+ public SysUser InsertUser(SysUser sysUser);
///
/// 修改用户信息
diff --git a/ZR.Service/System/SysUserService.cs b/ZR.Service/System/SysUserService.cs
index ff31d26..940bef8 100644
--- a/ZR.Service/System/SysUserService.cs
+++ b/ZR.Service/System/SysUserService.cs
@@ -105,16 +105,14 @@ namespace ZR.Service
///
///
///
- public long InsertUser(SysUser sysUser)
+ public SysUser InsertUser(SysUser sysUser)
{
- sysUser.Create_time = DateTime.Now;
- long userId = Insertable(sysUser).ExecuteReturnIdentity();
- sysUser.UserId = userId;
+ sysUser.UserId = Insertable(sysUser).ExecuteReturnIdentity();
//新增用户角色信息
UserRoleService.InsertUserRole(sysUser);
//新增用户岗位信息
UserPostService.InsertUserPost(sysUser);
- return userId;
+ return sysUser;
}
///