Beispiel #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));
        }