| | |
| | | success: function (res, status, xhr) { |
| | | // console.log(res); |
| | | // console.log(status); |
| | | |
| | | callbackFun(res); |
| | | }, |
| | | error: function (res, status, error) { |
| | | // console.log(res); |
| | | // console.log(status); |
| | | callbackFun(res, status, error); |
| | | callbackFun(res.responseJSON, status, error); |
| | | // layer.msg(res.statusText, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | sendData(IP + "/WeatherForecast/Login", param, 'post', function (res) { |
| | | console.log(res); |
| | | if (res.code == 200) { //成功 |
| | | $.cookie('token', res.ToKen.TokenStr); |
| | | $.cookie('token', res.data); |
| | | layer.msg("登录成功", { |
| | | icon: 1, |
| | | time: 1200 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.ErrorMsg, { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 1200 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | |
| | | UserId: id, |
| | | }; |
| | | sendData(IP + "/basis/GetUserinfoListById?Id= " +getQueryString('id')+ "", {}, 'get', function(res) { |
| | | if (res.code == 0) //成功 |
| | | if (res.code == 200) //成功 |
| | | { |
| | | //页面赋值 |
| | | if(res.data.UserNo != "") |
| | |
| | | |
| | | console.log(res.data) |
| | | |
| | | if (res.code == 0) //成功 |
| | | if (res.code == 200) //成功 |
| | | { |
| | | var list = res.data; |
| | | $.extend(infoOptions, { |
| | |
| | | doing = false; |
| | | sendData(IP + "/basis/InsertUserinfo", param, 'post',function(res) { |
| | | console.log(res); |
| | | if (res.code == 0) //成功 |
| | | if (res.code == 200) //成功 |
| | | { |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | |
| | | doing = false; |
| | | sendData(IP + "/Basis/DeleteUserInfo?Userids="+data.Id+"", {} , 'get', function(res) { |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | if (res.code == 200) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | doing = false; |
| | | sendData(IP + "/basis/UpdateUserinfo", param, 'post', |
| | | function(res) { |
| | | if (res.code == 0) { //成功 |
| | | if (res.code == 200) { //成功 |
| | | layer.msg("修改成功", { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | } |
| | | else //不成功 |
| | | { |
| | | debugger; |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | }); |
| | | |
| | | sendData(IP + "/Basis/IsPassWordTime", "", 'get', function(res) { |
| | | if (res.code == 0 && res.data == 1) { //成功 |
| | | if (res.code == 200 && res.data == 1) { //成功 |
| | | layer.open({ |
| | | type: 2, |
| | | title: '密码已过期,请修改密码', |
| | |
| | | doing = false; |
| | | sendData(IP + "/Basis/UptUserPassWord", param, 'get', function (res) { |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | if (res.code == 200) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | |
| | | namespace Utility |
| | | { |
| | | public class ApiResponseActionFilter: IAsyncActionFilter |
| | | public class ApiResponseActionFilter : IAsyncActionFilter |
| | | { |
| | | public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) |
| | | { |
| | |
| | | |
| | | await context.HttpContext.Response.WriteAsync(json); |
| | | } |
| | | if (resultContext.Result is EmptyResult) |
| | | { |
| | | var apiResponse = new ApiResponse<object>( |
| | | context.HttpContext.Response.StatusCode, |
| | | context.HttpContext.Response.StatusCode == 200 ? "请求成功" : "错误", |
| | | "请求成功" |
| | | ); |
| | | |
| | | var json = JsonConvert.SerializeObject(apiResponse); |
| | | context.HttpContext.Response.ContentType = "application/json"; |
| | | context.HttpContext.Response.ContentLength = Encoding.UTF8.GetByteCount(json); |
| | | |
| | | await context.HttpContext.Response.WriteAsync(json); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | outputTemplate: template, |
| | | restrictedToMinimumLevel: LogEventLevel.Information)) |
| | | // Debug日志写入到文件 |
| | | //.WriteTo.Async(c => c.File( |
| | | // path: "Logs/Debug.txt", |
| | | // rollingInterval: RollingInterval.Day, |
| | | // fileSizeLimitBytes: 1024 * 1024 * 10, |
| | | // retainedFileCountLimit: 100, |
| | | // outputTemplate: template, |
| | | // restrictedToMinimumLevel: LogEventLevel.Debug)) |
| | | .WriteTo.Async(c => c.File( |
| | | path: "Logs/Verbose.txt", |
| | | rollingInterval: RollingInterval.Day, |
| | | fileSizeLimitBytes: 1024 * 1024 * 10, |
| | | retainedFileCountLimit: 100, |
| | | outputTemplate: template, |
| | | restrictedToMinimumLevel: LogEventLevel.Verbose)) |
| | | // Warning日志写入到文件 |
| | | .WriteTo.Async(c => c.File( |
| | | path: "Logs/Warning_.txt", |
New file |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Security.Claims; |
| | | using System.Text; |
| | | |
| | | namespace Utility |
| | | { |
| | | public class UserManager |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | public int UserId |
| | | { |
| | | get => int.Parse(_httpContextAccessor.HttpContext?.User.FindFirst(ClaimTypes.Name)?.Value); |
| | | } |
| | | |
| | | |
| | | public string Account |
| | | { |
| | | get => _httpContextAccessor.HttpContext?.User.FindFirst(ClaimTypes.NameIdentifier)?.Value; |
| | | } |
| | | |
| | | |
| | | public UserManager(IHttpContextAccessor httpContextAccessor) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.Extensions.Logging; |
| | | using Utility.Entity; |
| | | using Newtonsoft.Json; |
| | | using System.Text; |
| | | |
| | | namespace Utility |
| | | { |
| | |
| | | message: result, |
| | | data: result |
| | | ); |
| | | |
| | | await context.Response.WriteAsync(JsonConvert.SerializeObject(apiResponse)); |
| | | var json = JsonConvert.SerializeObject(apiResponse); |
| | | context.Response.ContentType = "application/json"; |
| | | context.Response.ContentLength = Encoding.UTF8.GetByteCount(json); |
| | | await context.Response.WriteAsync(json); |
| | | } |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | /// 加载 WMS.BLL 类库 |
| | | Assembly assembly = Assembly.LoadFrom("bin\\Debug\\netcoreapp3.1\\WMS.BLL.dll"); |
| | | Assembly assembly; |
| | | try |
| | | { |
| | | assembly = Assembly.LoadFrom("WMS.BLL.dll"); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | assembly = Assembly.LoadFrom("bin\\Debug\\netcoreapp3.1\\WMS.BLL.dll"); |
| | | } |
| | | |
| | | // 获取 WMS.BLL的类型 |
| | | Type classType = assembly.GetType("WMS.BLL." + className); |
| | |
| | | using OracleInternal.Secure.Network; |
| | | using Utility.Tools; |
| | | using System.Linq; |
| | | using SqlSugar; |
| | | using WMS.Entity.Context; |
| | | using WMS.Entity.BllTaskEntity; |
| | | using WMS.DAL; |
| | | using Utility; |
| | | |
| | | namespace WMS.BLL.SysServer |
| | | { |
| | |
| | | public IUserInforRepository UserSvc { get; set; } |
| | | readonly IMapper _mapper; |
| | | private readonly IFunSettingServer _setting; |
| | | public UserInforServer(IUserInforRepository userSvc, IMapper mapper, IFunSettingServer setting) |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | private readonly UserManager _userManager; |
| | | public UserInforServer(IUserInforRepository userSvc, IMapper mapper, IFunSettingServer setting, UserManager userManager) |
| | | { |
| | | UserSvc = userSvc; |
| | | _mapper = mapper; |
| | | _setting = setting; |
| | | _userManager = userManager; |
| | | } |
| | | |
| | | public bool LoginAdmin(string loginName, string loginPwd, out int adminId) |
| | | public async Task<int> LoginAdmin(string loginName, string loginPwd) |
| | | { |
| | | //loginPwd = Md5Tools.CalcMd5(loginPwd); |
| | | var date = UserSvc.GetAllAsync().First(m => m.UserName == loginName && m.PassWord == loginPwd); |
| | | |
| | | if (date != null) //账号密码是否正确 |
| | | var modUser = await Db.Queryable<SysUserInfor>().FirstAsync(m => m.UserName == loginName && m.PassWord == loginPwd); |
| | | if (modUser != null) //账号密码是否正确 |
| | | { |
| | | if (date.Status == "0") //当前账号是否正常启用 |
| | | if (modUser.Status == "0") //当前账号是否正常启用 |
| | | { |
| | | //最后登陆时间 |
| | | UserSvc.UptUserLoginTime(date.Id); |
| | | adminId = date.Id; |
| | | return true; |
| | | await Db.Updateable(modUser).UpdateColumns(s => s.LoginTime == DateTime.Now).ExecuteCommandAsync(); |
| | | return modUser.Id; |
| | | } |
| | | else //当前账号被禁用 |
| | | { |
| | | adminId = 0; |
| | | return true; |
| | | return 0; |
| | | } |
| | | } |
| | | else //账号密码不正确或没有此账号 |
| | | { |
| | | adminId = 0; |
| | | return false; |
| | | return -1; |
| | | } |
| | | } |
| | | public SysUserInfor CeShi() |
| | |
| | | /// 获取用户角色信息 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<UserInfoDto> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status) |
| | | public async Task<List<UserInfoDto>> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status) |
| | | { |
| | | |
| | | string str = "select user1.Id Id,user1.UserNo UserNo,user1.UserName UserName,user1.RealName RealName,user1.PassWord PassWord,user1.JobNo JobNo,user1.Status Status,user1.Sex Sex,user1.Nationality Nationality,user1.CreateTime CreateTime,user1.CreateUser CreateUser,user1.Paper Paper,user1.Phone Phone,user1.Email Email,user1.Addres Addres,user1.Demo Demo,role.RoleName,user2.RealName CreateUserName,depa.DepartmentName DepartmentName from SysUserInfor user1 left join SysRoles role on user1.RoleNo = role.RoleNo left join SysUserInfor user2 on user1.CreateUser = user2.Id left join SysDepartment depa on user1.DepartmentNo = depa.DepartmentNo where user1.IsDel = '0'"; |
| | | |
| | | //判断登录名称是否为空 |
| | | if (!string.IsNullOrEmpty(UserName)) |
| | | { |
| | | str += $" and user1.UserName like '%{UserName}%'"; |
| | | } |
| | | //判断部门号是否为0 |
| | | if (!string.IsNullOrEmpty(DepartmentNo)) |
| | | { |
| | | str += $" and user1.DepartmentNo = '{DepartmentNo}'"; |
| | | } |
| | | //判断角色号是否为空 |
| | | if (!string.IsNullOrEmpty(RoleNo)) |
| | | { |
| | | str += $" and user1.RoleNo = '{RoleNo}'"; |
| | | } |
| | | //判断状态是否为空 |
| | | if (!string.IsNullOrEmpty(Status)) |
| | | { |
| | | str += $" and user1.Status = '{Status}'"; |
| | | } |
| | | |
| | | List<UserInfoDto> userInfoDtos = UserSvc.GetUserRoleList(str); |
| | | |
| | | //var arr = Md5Tools.CalcMd5(userInfoDtos[3].PassWord); |
| | | |
| | | return userInfoDtos; |
| | | return await Db.Queryable<SysUserInfor>() |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id) |
| | | .LeftJoin<SysDepartment>((a, b, c) => a.DepartmentNo == c.DepartmentNo) |
| | | .LeftJoin<SysRoles>((a, b, c, d) => a.RoleNo == d.RoleNo) |
| | | .WhereIF(!string.IsNullOrEmpty(UserName), a => a.UserName.Contains(UserName)) |
| | | .WhereIF(!string.IsNullOrEmpty(DepartmentNo), a => a.DepartmentNo == DepartmentNo) |
| | | .WhereIF(!string.IsNullOrEmpty(RoleNo), a => a.RoleNo == RoleNo) |
| | | .WhereIF(!string.IsNullOrEmpty(Status), a => a.Status == Status) |
| | | .Where(a => a.IsDel == "0") |
| | | .Select<UserInfoDto>() |
| | | .ToListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="userName">用户登录名</param> |
| | | /// <param name="id">用户ID</param> |
| | | /// <returns></returns> |
| | | public int GetUserInfoByNo(string userNo, string userName,int id) |
| | | public async Task<int> GetUserInfoByNo(string userNo, string userName, int id) |
| | | { |
| | | string str = $"select * from SysUserInfor where IsDel=0 and (UserNo = '{userNo}' or UserName = '{userName}') "; |
| | | if (id!=0) |
| | | { |
| | | str += $"and Id != {id} "; |
| | | } |
| | | List<SysUserInfor> user = UserSvc.GetUserInfoByNo(str); |
| | | return user.Count; |
| | | return await Db.Queryable<SysUserInfor>() |
| | | .Where(s => s.IsDel == "0") |
| | | .Where(s => s.UserNo == userNo || s.UserName == userName) |
| | | .WhereIF(id != 0, a => a.Id != id) |
| | | .CountAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <exception cref="Exception">异常</exception> |
| | | public async Task<int> InsertUserInfo(UserInfoDto UserInfoDto) |
| | | { |
| | | //异常 |
| | | try |
| | | //数据模型映射 |
| | | SysUserInfor userinfo = _mapper.Map<SysUserInfor>(UserInfoDto); |
| | | //判断用户号是否唯一 |
| | | int count = await GetUserInfoByNo(userinfo.UserNo, userinfo.UserName, 0); |
| | | int i = 0; |
| | | if (count > 0) |
| | | { |
| | | //数据模型映射 |
| | | SysUserInfor userinfo = _mapper.Map<SysUserInfor>(UserInfoDto); |
| | | //判断用户号是否唯一 |
| | | int count = GetUserInfoByNo(userinfo.UserNo,userinfo.UserName,0); |
| | | int i = 0; |
| | | if (count > 0) |
| | | { |
| | | i = 3; |
| | | } |
| | | else if (count ==0) |
| | | { |
| | | //新增用户 |
| | | i = await UserSvc.InsertUserInfo(userinfo); |
| | | } |
| | | return i; |
| | | throw Oops.Bah("用户名或登录名重复"); |
| | | } |
| | | catch (Exception ex) |
| | | else if (count == 0) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("新增用户信息异常", ex); |
| | | //新增用户 |
| | | //i = await UserSvc.InsertUserInfo(userinfo); |
| | | userinfo.PassWord = Md5Tools.CalcMd5("boxline"); |
| | | userinfo.SetPasswordTime = DateTime.Now; |
| | | userinfo.CreateTime = DateTime.Now; |
| | | i = await Db.Insertable(userinfo).ExecuteCommandAsync(); |
| | | if (i <= 0) |
| | | throw Oops.Bah("新增用户信息失败"); |
| | | } |
| | | return i; |
| | | |
| | | } |
| | | |
| | |
| | | /// <param name="user">用户实体模型</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception">异常</exception> |
| | | public async Task<int> DeleteUserinfo(SysUserInfor user) |
| | | public async Task DeleteUserinfo(SysUserInfor user) |
| | | { |
| | | //异常 |
| | | try |
| | | { |
| | | //删除 |
| | | int i = await UserSvc.DeleteUserinfo(user); |
| | | //返回数据 |
| | | return i; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("删除用户信息异常", ex); |
| | | } |
| | | await Db.Updateable<SysUserInfor>() |
| | | .Where(s => s.Id == user.Id) |
| | | .SetColumns(s => s.IsDel == "1") |
| | | .SetColumns(s => s.UpdateTime == DateTime.Now) |
| | | .SetColumns(s => s.UpdateUser == _userManager.UserId) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <exception cref="Exception">异常exception> |
| | | public async Task<int> UpdateUserinfo(UserInfoDto userdto) |
| | | { |
| | | //异常 |
| | | try |
| | | //映射数据模型 |
| | | SysUserInfor userlist = _mapper.Map<SysUserInfor>(userdto); |
| | | //判断用户号是否唯一 |
| | | int count = await GetUserInfoByNo(userdto.UserNo, userdto.UserName, userdto.Id); |
| | | int i = 0; |
| | | if (count > 0) |
| | | { |
| | | //映射数据模型 |
| | | SysUserInfor userlist = _mapper.Map<SysUserInfor>(userdto); |
| | | //判断用户号是否唯一 |
| | | int count = GetUserInfoByNo(userdto.UserNo, userdto.UserName,userdto.Id); |
| | | int i = 0; |
| | | if (count > 0) |
| | | { |
| | | i = 3; |
| | | } |
| | | else if (count == 0) |
| | | { |
| | | //编辑 |
| | | i = await UserSvc.UpdateUserinfo(userlist); |
| | | } |
| | | |
| | | return i; |
| | | throw Oops.Bah("用户名或登录名重复"); |
| | | } |
| | | catch (Exception ex) |
| | | else if (count == 0) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("编辑用户信息异常", ex); |
| | | userdto.UpdateTime = DateTime.Now; |
| | | i = await Db.Updateable(userlist) |
| | | .UpdateColumns(s => new { s.UserName, s.UserNo, s.Sex, s.RoleNo, s.RealName, s.Phone, s.Paper, s.Nationality, s.JobNo, s.Email, s.Demo, s.Addres }) |
| | | .ExecuteCommandAsync(); |
| | | if (i <= 0) |
| | | throw Oops.Bah("编辑用户信息失败"); |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="userids">用户id</param> |
| | | /// <returns></returns> |
| | | public SysUserInfor GetUserInfoById(int userids) |
| | | public async Task<SysUserInfor> GetUserInfoById(int userids) |
| | | { |
| | | //获取信息列表 |
| | | SysUserInfor user= UserSvc.GetUserInfoById(userids); |
| | | //返回数据 |
| | | return user; |
| | | return await Db.Queryable<SysUserInfor>().FirstAsync(s => s.Id == userids && s.IsDel == "0"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="userId">用户id</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception">捕获异常</exception> |
| | | public async Task<int> UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo, int userId) |
| | | public async Task<int> UptUserPassWord(string pwdNew, int userId) |
| | | { |
| | | //捕获异常 |
| | | try |
| | | { |
| | | //验证两次新密码是否一致 |
| | | if (pwdNew == pwdNewTwo) |
| | | { |
| | | int i = await UserSvc.UptUserPassWord(pwdOld, pwdNew, pwdNewTwo, userId); |
| | | return i; |
| | | } |
| | | else |
| | | { |
| | | return 3; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("修改密码异常",ex); |
| | | } |
| | | return await Db.Updateable<SysUserInfor>() |
| | | .Where(s => s.Id == userId) |
| | | .SetColumns(s => s.UpdateTime == DateTime.Now) |
| | | .SetColumns(s => s.UpdateUser == _userManager.UserId) |
| | | .SetColumns(s => s.SetPasswordTime == DateTime.Now) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | /// <summary> |
| | | /// x天后提醒用户修改密码 |
| | | /// </summary> |
| | | /// <param name="userId"></param> |
| | | /// <returns></returns> |
| | | public int IsPassWordTime(int userId) |
| | | public async Task<int> IsPassWordTime(int userId) |
| | | { |
| | | //捕获异常 |
| | | try |
| | | SysFunSetting funSettings = await Db.Queryable<SysFunSetting>().FirstAsync(a => a.IsDel == "0" && a.FunSetNo == "Fun026"); |
| | | if (funSettings != null && funSettings.IsEnable == "NO") |
| | | { |
| | | SysFunSetting funSettings = _setting.GetFunSettingByNo("Fun026"); |
| | | if (funSettings != null && funSettings.IsEnable == "NO") |
| | | SysUserInfor userinfo = await Db.Queryable<SysUserInfor>().FirstAsync(s => s.Id == userId && s.IsDel == "0"); |
| | | if (userinfo.SetPasswordTime != null) |
| | | { |
| | | SysUserInfor userinfo = UserSvc.GetAllAsync().First(m => m.Id == userId); |
| | | if (userinfo.SetPasswordTime != null) |
| | | int days = string.IsNullOrEmpty(funSettings.SetValue) ? 30 : Convert.ToInt32(funSettings.SetValue); |
| | | bool isTime = userinfo.SetPasswordTime.Value.AddDays(days) < DateTime.Now; |
| | | if (isTime) |
| | | { |
| | | int days = string.IsNullOrEmpty(funSettings.SetValue) ? 30 : Convert.ToInt32(funSettings.SetValue); |
| | | bool isTime = userinfo.SetPasswordTime.Value.AddDays(days) < DateTime.Now; |
| | | if (isTime) |
| | | { |
| | | return 1; |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("修改密码异常", ex); |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface IUserInforServer |
| | | { |
| | | bool LoginAdmin(string loginName, string loginPwd, out int adminId); |
| | | Task<int> LoginAdmin(string loginName, string loginPwd); |
| | | SysUserInfor CeShi(); |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="RoleNo">角色号</param> |
| | | /// <param name="Status">状态</param> |
| | | /// <returns></returns> |
| | | List<UserInfoDto> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status); |
| | | Task<List<UserInfoDto>> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status); |
| | | |
| | | /// <summary> |
| | | /// 根据编号获取用户信息列表 |
| | |
| | | /// <param name="userName">用户登录名</param> |
| | | /// <param name="id">用户ID</param> |
| | | /// <returns></returns> |
| | | int GetUserInfoByNo(string userNo, string userName,int id); |
| | | Task<int> GetUserInfoByNo(string userNo, string userName,int id); |
| | | |
| | | /// <summary> |
| | | /// 新增用户信息 |
| | |
| | | /// </summary> |
| | | /// <param name="user">用户实体模型</param> |
| | | /// <returns></returns> |
| | | Task<int> DeleteUserinfo(SysUserInfor user); |
| | | Task DeleteUserinfo(SysUserInfor user); |
| | | |
| | | /// <summary> |
| | | /// 编辑用户信息 |
| | |
| | | /// </summary> |
| | | /// <param name="userids">用户id</param> |
| | | /// <returns></returns> |
| | | SysUserInfor GetUserInfoById(int userids); |
| | | Task<SysUserInfor> GetUserInfoById(int userids); |
| | | |
| | | /// <summary> |
| | | /// 修改用户密码 |
| | | /// </summary> |
| | | /// <param name="pwdOld">原密码</param> |
| | | /// <param name="pwdNew">新密码</param> |
| | | /// <param name="pwdNewTwo">确认密码</param> |
| | | /// <param name="userId">用户id</param> |
| | | /// <returns></returns> |
| | | Task<int> UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo, int userId); |
| | | Task<int> UptUserPassWord(string pwdNew, int userId); |
| | | |
| | | /// <summary> |
| | | /// x天后提醒用户修改密码 |
| | | /// </summary> |
| | | /// <param name="userId"></param> |
| | | /// <returns></returns> |
| | | int IsPassWordTime(int userId); |
| | | Task<int> IsPassWordTime(int userId); |
| | | } |
| | | } |
| | |
| | | using System.Security.Cryptography; |
| | | using System.Data; |
| | | using Model.ModelDto.LogDto; |
| | | using Utility; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | private readonly IFunSettingServer _setting; //功能设定 |
| | | private readonly IInterfaceServer _interface;//接口管理 |
| | | private readonly IOperationSysServer _operation; //操作日志 |
| | | private readonly UserManager _userManager; |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | |
| | | /// <param name="department">部门</param> |
| | | /// <param name="setting">功能设定</param> |
| | | /// <param name="operation">操作日志</param> |
| | | public BasisController(ICustomerServer customerSvc, ILogisticsInfoServer logisticsSvc, IUserInforServer userInforServer, IRolesServer rolesServer, IRoleRightServer roleRightServer, IRBACServer rBACServer, IUnitServer unitSvc, IPackagServer packagServer, IMaterialsServer mate, IDepartmentServer department, IFunSettingServer setting, IInterfaceServer interfaceS, IOperationSysServer operation) |
| | | public BasisController(ICustomerServer customerSvc, ILogisticsInfoServer logisticsSvc, IUserInforServer userInforServer, IRolesServer rolesServer, IRoleRightServer roleRightServer, IRBACServer rBACServer, IUnitServer unitSvc, IPackagServer packagServer, IMaterialsServer mate, IDepartmentServer department, IFunSettingServer setting, IInterfaceServer interfaceS, IOperationSysServer operation, UserManager userManager) |
| | | { |
| | | _customerSvc = customerSvc;//客户Svc |
| | | _logisticsSvc = logisticsSvc;//物流Svc |
| | |
| | | _setting = setting; //功能设定 |
| | | _interface = interfaceS;//接口管理 |
| | | _operation = operation; //操作日志 |
| | | _userManager = userManager; |
| | | } |
| | | //基本信息管理 |
| | | |
| | |
| | | /// <param name="Status">状态</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<List<UserInfoDto>> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status) |
| | | { |
| | | List<UserInfoDto> userdtolist = _userInforServer.GetUserRoleList(UserName, DepartmentNo, RoleNo, Status); |
| | | return Ok(new |
| | | { |
| | | data = userdtolist, |
| | | code = 0, |
| | | mes = "成功" |
| | | }); |
| | | return await _userInforServer.GetUserRoleList(UserName, DepartmentNo, RoleNo, Status); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="id">用户id</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetUserinfoListById(int id) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SysUserInfor> GetUserinfoListById(int id) |
| | | { |
| | | SysUserInfor userinfo = _userInforServer.GetUserInfoById(id); |
| | | return Ok(new |
| | | { |
| | | data = userinfo, |
| | | code = 0, |
| | | msg = "成功" |
| | | }); |
| | | return await _userInforServer.GetUserInfoById(id); |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="System.Exception">捕获异常</exception> |
| | | [HttpPost] |
| | | public async Task<IActionResult> InsertUserinfo(UserInfoDto UserInfoDto) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task InsertUserinfo(UserInfoDto UserInfoDto) |
| | | { |
| | | //捕获异常 |
| | | try |
| | | { |
| | | //获取当前操作用户id |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | int uid = Convert.ToInt32(userId); |
| | | UserInfoDto.CreateUser = uid; |
| | | int i = await _userInforServer.InsertUserInfo(UserInfoDto); |
| | | UserInfoDto.CreateUser = _userManager.UserId; |
| | | await _userInforServer.InsertUserInfo(UserInfoDto); |
| | | await _operation.InsertOperation("系统设置", "用户管理", UserInfoDto.UserNo, "添加", "添加用户信息 用户号:" + UserInfoDto.UserNo, _userManager.UserId); |
| | | |
| | | //判断是否新增成功 |
| | | if (i == 0) |
| | | { |
| | | return Ok(new { data = i, code = 1, msg = "新增失败" }); |
| | | } |
| | | else if (i == 3) |
| | | { |
| | | return Ok(new { data = i, code = 3, msg = "用户名或登录名重复" }); |
| | | } |
| | | else |
| | | { |
| | | await _operation.InsertOperation("系统设置", "用户管理", UserInfoDto.UserNo, "添加", "添加用户信息 用户号:" + UserInfoDto.UserNo, uid); |
| | | return Ok(new { data = i, code = 0, msg = "新增成功" }); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new System.Exception("新增用户异常", ex); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="System.Exception">异常</exception> |
| | | [HttpGet] |
| | | public async Task<IActionResult> DeleteUserInfo(int userids) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task DeleteUserInfo(int userids) |
| | | { |
| | | //异常 |
| | | try |
| | | { |
| | | //获取用户信息 |
| | | SysUserInfor user = _userInforServer.GetUserInfoById(userids); |
| | | //获取当前操作用户id |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | int uid = Convert.ToInt32(userId); |
| | | int i = await _userInforServer.DeleteUserinfo(user); |
| | | //判断是否删除成功 |
| | | if (i == 0) |
| | | { |
| | | return Ok(new { data = i, code = 1, msg = "删除失败" }); |
| | | } |
| | | else |
| | | { |
| | | await _operation.InsertOperation("系统设置", "用户管理", user.UserNo, "删除", "删除用户信息 用户号:" + user.UserNo, uid); |
| | | return Ok(new { data = i, code = 0, msg = "删除成功" }); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new System.Exception("删除用户信息异常", ex); |
| | | } |
| | | //获取用户信息 |
| | | SysUserInfor user = await _userInforServer.GetUserInfoById(userids); |
| | | await _userInforServer.DeleteUserinfo(user); |
| | | await _operation.InsertOperation("系统设置", "用户管理", user.UserNo, "删除", "删除用户信息 用户号:" + user.UserNo, _userManager.UserId); |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="System.Exception">捕获异常</exception> |
| | | [HttpPost] |
| | | public async Task<IActionResult> UpdateUserinfo(UserInfoDto userdto) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task UpdateUserinfo(UserInfoDto userdto) |
| | | { |
| | | //捕获异常 |
| | | try |
| | | { |
| | | //获取当前操作用户id |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | int uid = Convert.ToInt32(userId); |
| | | //userdto.UpdateUser = Convert.ToInt32(userId); |
| | | //更改人 |
| | | userdto.UpdateUser = uid; |
| | | userdto.UpdateUser = _userManager.UserId; |
| | | await _userInforServer.UpdateUserinfo(userdto); |
| | | await _operation.InsertOperation("系统设置", "用户管理", userdto.UserNo, "修改", "修改用户信息 用户号:" + userdto.UserNo, _userManager.UserId); |
| | | |
| | | //编辑用户信息 |
| | | int i = await _userInforServer.UpdateUserinfo(userdto); |
| | | //判断是否编辑成功 |
| | | if (i == 0) |
| | | { |
| | | return Ok(new { data = i, code = 1, msg = "编辑失败" }); |
| | | } |
| | | else if (i == 3) |
| | | { |
| | | return Ok(new { data = i, code = 1, msg = "用户名或登录名重复" }); |
| | | } |
| | | else |
| | | { |
| | | await _operation.InsertOperation("系统设置", "用户管理", userdto.UserNo, "修改", "修改用户信息 用户号:" + userdto.UserNo, uid); |
| | | return Ok(new { data = i, code = 0, msg = "编辑成功" }); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new System.Exception("编辑用户信息异常", ex); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="PassWord">用户原密码</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public int GetUserUptPassById(string PassWord, int userId) |
| | | { |
| | | ////获取当前操作用户id |
| | | //var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | //var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | //int uid = Convert.ToInt32(userId); |
| | | |
| | | //根据用户id获取用户密码 |
| | | SysUserInfor user = _userInforServer.GetUserInfoById(userId); |
| | | //判断原密码是否正确 |
| | | if (user.PassWord == PassWord) |
| | | { |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | //[HttpGet] |
| | | //public async int GetUserUptPassById(string PassWord, int userId) |
| | | //{ |
| | | // //根据用户id获取用户密码 |
| | | // SysUserInfor user = await _userInforServer.GetUserInfoById(userId); |
| | | // //判断原密码是否正确 |
| | | // if (user.PassWord == PassWord) |
| | | // { |
| | | // return 1; |
| | | // } |
| | | // else |
| | | // { |
| | | // return 0; |
| | | // } |
| | | //} |
| | | |
| | | ///// <param name="userId">用户id</param> |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception">捕获异常</exception> |
| | | [HttpGet] |
| | | public async Task<IActionResult> UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo/*, int userId*/) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo/*, int userId*/) |
| | | { |
| | | //捕获异常 |
| | | try |
| | | pwdOld = Md5Tools.CalcMd5(pwdOld); |
| | | pwdNew = Md5Tools.CalcMd5(pwdNew); |
| | | pwdNewTwo = Md5Tools.CalcMd5(pwdNewTwo); |
| | | //获取当前操作用户id |
| | | SysUserInfor user = await _userInforServer.GetUserInfoById(_userManager.UserId); |
| | | if (user == null) |
| | | { |
| | | pwdOld = Md5Tools.CalcMd5(pwdOld); |
| | | pwdNew = Md5Tools.CalcMd5(pwdNew); |
| | | pwdNewTwo = Md5Tools.CalcMd5(pwdNewTwo); |
| | | //获取当前操作用户id |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | int uid = Convert.ToInt32(userId); |
| | | //判断原密码是否正确 |
| | | int a = GetUserUptPassById(pwdOld, uid); |
| | | if (a == 1) |
| | | { |
| | | //修改密码 |
| | | int i = await _userInforServer.UptUserPassWord(pwdOld, pwdNew, pwdNewTwo, uid); |
| | | if (i == 0) |
| | | { |
| | | return Ok(new |
| | | { |
| | | data = i, |
| | | code = 1, |
| | | msg = "修改失败" |
| | | }); |
| | | } |
| | | //判断两次新密码是否一致 |
| | | else if (i == 3) |
| | | { |
| | | return Ok(new |
| | | { |
| | | data = i, |
| | | code = 0, |
| | | msg = "修改成功 请重新登录" |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new |
| | | { |
| | | data = i, |
| | | code = 0, |
| | | msg = "修改成功 请重新登录" |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //错误 |
| | | return Ok(new |
| | | { |
| | | data = a, |
| | | code = 1, |
| | | msg = "原密码不正确" |
| | | }); |
| | | } |
| | | |
| | | throw Oops.Bah("找不到用户信息"); |
| | | } |
| | | catch (Exception ex) |
| | | if (user.PassWord != pwdOld) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("修改密码异常", ex); |
| | | throw Oops.Bah("原密码不正确"); |
| | | } |
| | | else |
| | | { |
| | | //修改密码 |
| | | int i = await _userInforServer.UptUserPassWord(pwdNew, _userManager.UserId); |
| | | if (i <= 0) |
| | | throw Oops.Bah("修改密码失败"); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult IsPassWordTime() |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<int> IsPassWordTime() |
| | | { |
| | | //捕获异常 |
| | | try |
| | | { |
| | | //获取当前操作用户id |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | int uid = Convert.ToInt32(userId); |
| | | //判断原密码是否正确 |
| | | int a = _userInforServer.IsPassWordTime(uid); |
| | | return Ok(new |
| | | { |
| | | data = a, |
| | | code = 0, |
| | | msg = "修改失败" |
| | | }); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异常 |
| | | throw new Exception("修改密码异常", ex); |
| | | } |
| | | return await _userInforServer.IsPassWordTime(_userManager.UserId); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | matedto.CreateUser = uid; |
| | | //新增 |
| | | int i = await _mate.AddMate(matedto); |
| | | |
| | | |
| | | await _operation.InsertOperation("基础信息", "物料管理", matedto.SkuNo, "添加", "添加物料信息 物料号:" + matedto.SkuNo, uid); |
| | | return Ok(new { data = i, code = 0, msg = "成功" }); |
| | | |
| | |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异常 |
| | | return Ok(new { code = 1, msg = "新增物料异常"+ ex.Message }); |
| | | return Ok(new { code = 1, msg = "新增物料异常" + ex.Message }); |
| | | } |
| | | } |
| | | |
| | |
| | | catch (Exception ex) |
| | | { |
| | | //抛出异 |
| | | return Ok(new { code = 1, msg = "编辑物料异常"+ex.Message }); |
| | | return Ok(new { code = 1, msg = "编辑物料异常" + ex.Message }); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | var bolls = _customerSvc.GetCustomerList(model.CustomerNo,model.CustomerName, model.Type, model.LinkMan, model.Phone, model.Page, model.Limit, out int count); |
| | | var bolls = _customerSvc.GetCustomerList(model.CustomerNo, model.CustomerName, model.Type, model.LinkMan, model.Phone, model.Page, model.Limit, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "客户信息", data = bolls }); |
| | | } |
| | |
| | | using WMS.Entity.Context; |
| | | using WMS.IBLL.ISysServer; |
| | | using Wms.Tools; |
| | | using Utility; |
| | | |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | [Authorize] |
| | | public class WeatherForecastController : ControllerBase |
| | | { |
| | | private static readonly string[] Summaries = new[] |
| | |
| | | _userMan = userMan; |
| | | } |
| | | |
| | | [AllowAnonymous] |
| | | [HttpGet] |
| | | public IEnumerable<WeatherForecast> Get() |
| | | { |
| | | var rng = new Random(); |
| | | //Db.Init(); |
| | | _logger.LogError("这是记录的信息"); |
| | | |
| | | |
| | | var data = Enumerable.Range(1, 5).Select(index => new WeatherForecast |
| | | { |
| | | Date = DateTime.Now.AddDays(index), |
| | | TemperatureC = rng.Next(-20, 55), |
| | | Summary = Summaries[rng.Next(Summaries.Length)] |
| | | }) |
| | | .ToArray(); |
| | | .ToArray(); |
| | | var list = JsonConvert.SerializeObject(data); |
| | | string LogAddress = @".\log\CreatMesTask物料转移" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; |
| | | LogFile.SaveLogToFile("接收物料转移任务:(" + list + "),", LogAddress); |
| | | _logger.LogWarning("接收物料转移任务:(" + list + "),"); |
| | | return data; |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="model">登录名</param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult Login(LoginVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<string> Login(LoginVm model) |
| | | { |
| | | if (ModelState.IsValid) |
| | | { |
| | | try |
| | | { |
| | | var bolls = _userMan.LoginAdmin(model.LoginName, model.LoginPwd, out int userId); |
| | | var userId = await _userMan.LoginAdmin(model.LoginName, model.LoginPwd); |
| | | |
| | | if (bolls) // |
| | | if (userId != -1) // |
| | | { |
| | | if (userId != 0) //正确返回 |
| | | { |
| | | if (userId != 0) //正确返回 |
| | | { |
| | | Dictionary<string, string> keyValuePairs = new Dictionary<string, string> |
| | | Dictionary<string, string> keyValuePairs = new Dictionary<string, string> |
| | | { |
| | | {"loginID", userId.ToString()}, |
| | | {"LoginName", model.LoginName} |
| | | }; |
| | | var tnToken = tokenHelper.CreateToken(keyValuePairs); |
| | | return Ok(new { code = 200, ToKen = tnToken }); |
| | | } |
| | | else //当前账号被禁用 |
| | | { |
| | | //return this.ErrorData($"当前账号已被禁用"); |
| | | return Ok(new { code = 400, ErrorMsg = "当前账号已被禁用" }); |
| | | } |
| | | var tnToken = tokenHelper.CreateToken(keyValuePairs); |
| | | return tnToken.TokenStr; |
| | | } |
| | | else //账号密码错误 |
| | | else //当前账号被禁用 |
| | | { |
| | | return Ok(new { code = 400, ErrorMsg = "当前账号或密码错误" }); |
| | | //return this.ErrorData($"当前账号已被禁用"); |
| | | throw Oops.Bah("当前账号已被禁用"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | else //账号密码错误 |
| | | { |
| | | return Ok(new { code = 400, ErrorMsg = "请联系管理员/" + e.Message }); |
| | | throw Oops.Bah("当前账号或密码错误"); |
| | | } |
| | | } |
| | | else //数据格式错误 |
| | | { |
| | | return Ok(new { code = 400, ErrorMsg = "数据格式错误" }); |
| | | throw Oops.Bah("数据格式错误"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 登录 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult ceshi() |
| | | { |
| | |
| | | var bolls = _userMan.CeShi(); |
| | | |
| | | return Ok(new { code = 200, data = bolls }); |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | var url2 = Configuration.GetSection("ApiUrlConfig:AgvHost").Value + Configuration.GetSection("ApiUrlConfig:IssueComApiUrl").Value; |
| | | //调用定时任务 |
| | | services.AddHostedService<DailyTaskService>(provider => |
| | | new DailyTaskService(url,url2)); |
| | | new DailyTaskService(url, url2)); |
| | | |
| | | services.AddControllers(options => { |
| | | services.AddControllers(options => |
| | | { |
| | | options.Filters.Add<RequestAuditLogFilter>(); |
| | | }) |
| | | .AddJsonOptions(options => |
| | |
| | | .SetIsOriginAllowed(_ => true) |
| | | .AllowAnyHeader() |
| | | .AllowCredentials(); |
| | | |
| | | |
| | | }); |
| | | }); |
| | | #endregion |
| | |
| | | #endregion |
| | | |
| | | //读取配置文件配置的接口交互的相关配置 |
| | | services.Configure<ApiUrlConfig>(Configuration.GetSection("ApiUrlConfig")); |
| | | services.Configure<ApiUrlConfig>(Configuration.GetSection("ApiUrlConfig")); |
| | | //数据库配置 |
| | | BaseDbConfig.ConnectionString = Configuration.GetSection("AppSettings:ConnectionString").Value; |
| | | //验签配置文件 |
| | | SignConfig.ERPAppKey = Configuration.GetSection("SignConfig:ERPAppKey").Value; |
| | | SignConfig.MESAppKey = Configuration.GetSection("SignConfig:MESAppKey").Value; |
| | | SignConfig.LIMSAppKey = Configuration.GetSection("SignConfig:LIMSAppKey").Value; |
| | | SignConfig.ERPAppKey = Configuration.GetSection("SignConfig:ERPAppKey").Value; |
| | | SignConfig.MESAppKey = Configuration.GetSection("SignConfig:MESAppKey").Value; |
| | | SignConfig.LIMSAppKey = Configuration.GetSection("SignConfig:LIMSAppKey").Value; |
| | | SignConfig.FuMaAppKey = Configuration.GetSection("SignConfig:FuMaAppKey").Value; |
| | | SignConfig.Minutes = double.Parse(Configuration.GetSection("SignConfig:Minutes").Value); |
| | | |
| | |
| | | |
| | | services.AddHostedService<HostedService>(); |
| | | services.AddSingleton<SchedulerCenter>(); |
| | | |
| | | services.AddTransient<UserManager>(); |
| | | services.AddTransient<IHttpContextAccessor, HttpContextAccessor>(); |
| | | } |
| | | public void ConfigureContainer(ContainerBuilder builder) |
| | | { |
| | |
| | | //app.UseHttpsRedirection(); |
| | | |
| | | app.UseRouting(); |
| | | |
| | | |
| | | app.UseAuthentication(); |
| | | app.UseAuthorization(); |
| | | app.UseCors("MyCors");//跨域 |