You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.7 KiB
81 lines
2.7 KiB
using System;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using HTIS.Model;
|
|
using QMAPP.Entity.Sys;
|
|
using QMAPP.BLL.Sys;
|
|
|
|
namespace SSC
|
|
{
|
|
/// <summary>
|
|
/// 登录
|
|
/// </summary>
|
|
public class Z002 : NSC.IService
|
|
{
|
|
public NSC.NetServiceStruct ServiceFunction(Common.Data.UserAuthority userAuth, NSC.NetServiceStruct input)
|
|
{
|
|
try
|
|
{
|
|
string deviceName = input.FirmwareModel;//设备型号
|
|
string systemID = input.Params["SystemID"].GetString();
|
|
string userName = input.Params["UserName"].GetString();//登录账号
|
|
string password = input.Params["Password"].GetString();//登录密码
|
|
T_QM_USERINFO userModel = new T_QM_USERINFO();
|
|
List<T_QM_SYSMENU_EMB> limitModels = new List<T_QM_SYSMENU_EMB>();
|
|
|
|
input.Returns = new Dictionary<string, NSC.ParameterStruct>();
|
|
|
|
//验证用户
|
|
LoginInfo login = new LoginInfo();
|
|
login.LoginUserID = userName.ToUpper();
|
|
login.PassWord = password;
|
|
|
|
//提交验证
|
|
login = new LoginBLL().IsLogin(login);
|
|
|
|
if (login != null)
|
|
{
|
|
//验证通过
|
|
userModel.USERID = login.UserID;
|
|
userModel.USERNAME = login.LoginUserID;
|
|
userModel.USERDES = login.UserName;
|
|
|
|
//获取权限数据
|
|
DataTable menuDt = new LoginBLL().GetEmbeddedMenus(systemID, userModel.USERID);
|
|
|
|
limitModels = QMFrameWork.Common.Util.BindHelper.ConvertToList<T_QM_SYSMENU_EMB>(menuDt).ToList();
|
|
}
|
|
else
|
|
{
|
|
login=new LoginInfo();
|
|
login.Message="用户名或密码不正确!";
|
|
}
|
|
|
|
if (login.IsAdmin!=null&&login.IsAdmin.ToLower() == "false")
|
|
{
|
|
for (int i = limitModels.Count - 1; i >= 0; i--)
|
|
{
|
|
if (login.Powers.IndexOf(limitModels[i].PID) < 0)
|
|
{
|
|
limitModels.RemoveAt(i);
|
|
}
|
|
}
|
|
}
|
|
|
|
//附加用户信息
|
|
input.Returns.Add("UserInfo", new NSC.ParameterStruct(userModel));
|
|
|
|
//附加权限信息
|
|
input.Returns.Add("UserLimit", new NSC.ParameterStruct(limitModels));
|
|
|
|
return input;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|