Пример #1
0
        public ActionResult Login_SubmitDate_Api(string userName, string pwd)
        {
            AjaxResult result  = new AjaxResult("登陆成功");
            string     message = "";

            if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(pwd))
            {
                result.Result  = false;
                result.Message = "请填写用户名和密码";
                return(Json(result));
            }
            var appList    = new List <UserCenter_Apps>();
            var userResult = UserCenterUserInfoApi.UserLogin(userName, pwd, out appList, out message);

            if (userResult == null)
            {
                result.Result  = false;
                result.Message = "用户名或密码错误";
                return(Json(result));
            }

            //获取当前用户拥有产品的城市
            int    nowCityId = WebUserHelp.GetNowCityId();
            string lastuser  = WebUserHelp.GetLastUserName();

            //int[] ints = UserCenterUserInfoApi.GetCompanyProductCityIds(userResult.SignName, FxtAPI.FxtUserCenter.Common.systypeCode, userResult.UserName, userResult.SignName, appList);
            //WebUserHelp.SetNowRightCityList(ints);

            //IList <SYSMenu> menuList = SYSMenuManager.GetSYSMenuPageByUserNameAndCompanyIdAndCityId(userName, userResult.FxtCompanyId, nowCityId);
            WebUserHelp.SetNowLoginUser(userResult, appList, null, null);

            result.Data = new
            {
                userinfo   = userResult,
                islastuser = userName == lastuser ? "1" : "0",
                cityid     = nowCityId
            };
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        //[AllowAnonymous]
        public ActionResult Login(string type, string path)
        {
            ViewBag.LastUserName = WebUserHelp.GetLastUserName();
            //LNKPPhotoManager.GetLNKPPhotoCountByProjectId(0, 6, 25);
            if (type == "signout")
            {
                WebUserHelp.SignOutLoginUser();

                Response.Redirect(WebCommon.Url_Login_Login);

                return(null);
            }
            else if (type == "open")
            {
                ViewBag.LastPageType = "open";
            }
            if (WebUserHelp.GetNowLoginUser() != null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(View());
        }
Пример #3
0
 public ActionResult LoginBox()
 {
     ViewBag.LastUserName = WebUserHelp.GetLastUserName();
     return(View());
 }