Beispiel #1
0
        /// <summary>
        /// 判断权限
        /// </summary>
        private string GetVoidHtml()
        {
            string tempStr = string.Empty;

            JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit();
            string            u_id      = UserInfo.UserId.ToString();
            int r_id = UserInfo.UserRid;
            //一键解冻
            bool getUidT = bll_limit.GetLocUserLimitVoids("/AppUser/doAll(1)", u_id, r_id);

            if (getUidT)
            {
                tempStr += "<li onclick=\"doAll(1)\"><i class='fa fa-check-square-o'></i>一键解冻</li>";
            }
            //一键冻结
            bool getUidF = bll_limit.GetLocUserLimitVoids("/AppUser/doAll(0)", u_id, r_id);

            if (getUidF)
            {
                tempStr += "<li onclick=\"doAll(0)\"><i class='fa fa-check-square-o'></i>一键冻结</li>";
            }
            //添加用户
            var getlocuserAdd = bll_limit.GetLocUserLimitVoids("/AppUser/AddUser", u_id, r_id);

            if (getlocuserAdd)
            {
                tempStr += "<li onclick=\"AddDlg()\"><i class='fa fa-plus'></i>添加用户</li>";
            }
            return(tempStr);
        }
Beispiel #2
0
        public JsonResult UserLogin(string logName, string logPwd, string valCode)
        {
            //获取开发者平台地址

            object result = new { msg = "验证码错误!", success = "0" };

            if (valCode == Session["ValidateCode"].ToString())
            {
                string Pwd = DESEncrypt.Encrypt(logPwd);

                string            Userurl   = System.Configuration.ConfigurationManager.AppSettings["Userurl"] + "?qs=" + DESEncrypt.Encrypt(logName + ";" + Pwd + ";0;" + System.DateTime.Now.ToString());
                JMP.BLL.jmp_limit bll_limit = new JMP.BLL.jmp_limit();
                JMP.BLL.jmp_user  bll       = new JMP.BLL.jmp_user();
                JMP.MDL.jmp_user  model     = bll.GetModel(logName);

                if (model != null && model.u_state == 1)
                {
                    if ((model.u_email == logName || model.u_phone == logName) && model.u_password == Pwd)
                    {
                        UserInfo.UserId     = model.u_id;
                        UserInfo.UserName   = model.u_realname;
                        UserInfo.UserNo     = model.u_email;
                        UserInfo.UserRoleId = model.u_role_id;
                        DataTable dtLimit = bll_limit.GetAppUserLimitSession(model.u_id, model.u_role_id);
                        if (dtLimit.Rows.Count > 0)
                        {
                            result = new { msg = "登录成功!", success = "1", url = Userurl };
                        }
                        else
                        {
                            result = new { msg = "权限不足!", success = "2" };
                        }
                    }
                    else
                    {
                        result = new { msg = "用户名或密码错误!", success = "2" };
                    }
                }
                else
                {
                    if (model == null)
                    {
                        result = new { msg = "用户名或密码错误!", success = "2" };
                    }
                    else if (model.u_state != 1)
                    {
                        result = new { msg = "该账号已冻结!", success = "2" };
                    }
                }


                //result = new { msg = "验证码成功!", status = 1, url = Userurl };
            }

            return(Json(result));
        }