身份验证
This commit is contained in:
46
NX.ERP.U8/System/User.cs
Normal file
46
NX.ERP.U8/System/User.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Dapper;
|
||||
|
||||
|
||||
namespace NX.ERP.U8.User
|
||||
|
||||
{
|
||||
public class User
|
||||
{
|
||||
|
||||
|
||||
|
||||
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