出库单返回单号
增加登录验证
This commit is contained in:
@@ -259,7 +259,18 @@ namespace NX.ERP.U8.Store
|
||||
|
||||
try
|
||||
{
|
||||
return AddRdVoucher(voucherParameter);
|
||||
var voucherId = AddRdVoucher(voucherParameter);
|
||||
if (!string.IsNullOrEmpty(voucherId))
|
||||
{
|
||||
var model = this.GetModel(int.Parse(voucherId));
|
||||
if (model!=null)
|
||||
{
|
||||
voucherId = model.Code;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return voucherId;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
@@ -294,6 +305,13 @@ namespace NX.ERP.U8.Store
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialStoreOut GetModel(int Id)
|
||||
{
|
||||
return GetList(" a.id=@id", new { Id }).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public MaterialStoreOut GetModel(string Code)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
|
||||
@@ -17,22 +19,15 @@ namespace NX.ERP.U8.User
|
||||
|
||||
public IEnumerable<Model.Request.User> GetList(string strWhere = "", object Param = null)
|
||||
{
|
||||
|
||||
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
var sql = @" select cUser_Id as UserCode ,cUser_Name as UserName from UFSystem..UA_User ";
|
||||
var sql = @" select cUser_Id as UserCode ,cUser_Name as UserName,cPassword as mdPassword from UFSystem..UA_User ";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Model.Request.User>(sql, Param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,23 +39,37 @@ namespace NX.ERP.U8.User
|
||||
|
||||
|
||||
|
||||
public bool Login(string UserId, string Password)
|
||||
{
|
||||
byte[] byte1 = Encoding.UTF8.GetBytes(Password);
|
||||
SHA1Managed sHA1Managed = new SHA1Managed();
|
||||
var hashValue = sHA1Managed.ComputeHash(byte1);
|
||||
var mdPassword = Convert.ToBase64String(hashValue) + (char)3;
|
||||
//密码密文
|
||||
var userDal = new UserDal();
|
||||
var user = userDal.GetModel(UserId);
|
||||
if (user == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (user.MdPassword != mdPassword)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public string Userrole(string Opnanme, string Pasd)
|
||||
{
|
||||
var AccID = ConfigurationManager.AppSettings["AccId"];
|
||||
//NX.ERP.U8.U8LoginContext.Instance.PassWord = System.Configuration.ConfigurationManager.AppSettings["Password"];
|
||||
|
||||
//NX.ERP.U8.U8LoginContext.Instance.UserId = System.Configuration.ConfigurationManager.AppSettings["UserId"];
|
||||
|
||||
var Server = ConfigurationManager.AppSettings["Server"];
|
||||
var _login = new NX.ERP.U8.U8LoginContext(Server, AccID);
|
||||
_login.Login(Opnanme, Pasd);
|
||||
|
||||
var sql = $@" SELECT 1 from UFSystem..UA_Role where cUser_Id=@Opnanme and cGroup_Id='report' ;";
|
||||
|
||||
|
||||
|
||||
using (var conn = _login.Connection)
|
||||
{
|
||||
return conn.ExecuteScalar<string>(sql, new { Opnanme }, null, 30, System.Data.CommandType.Text);
|
||||
|
||||
Reference in New Issue
Block a user