Exemplo n.º 1
0
        /// <summary>
        /// 编辑账号
        /// </summary>
        /// <param name="Param"></param>
        /// <returns></returns>
        public string EditInfo(RequestGovtInfo Param)
        {
            Param.PassWord = "******";
            GovtInfo Info = Param.MapToEntity <GovtInfo>();

            return(Insert(Info) ? ServiceMessage.INSERTSUCCESS : ServiceMessage.INSERTFAIL);
        }
Exemplo n.º 2
0
 public ObjectResultEx GovtLogin(RequestGovtInfo Param)
 {
     try
     {
         var    GovtAdmin = GovtWebService.GovtLogin(Param);
         string Code      = string.Empty;
         if (!Param.IsApp)
         {
             Code = CacheFactory.Cache().GetCache <string>("ValidateCode").Trim();
             if (GovtAdmin != null && Code.ToUpper().Equals(Param.ValidateCode.Trim().ToUpper()))
             {
                 CookieInfo cookie = new CookieInfo();
                 VerificationExtension.WriteToken(cookie, GovtAdmin);
                 return(ObjectResultEx.Instance(new { ResponseCookieInfo.RSAToKen, ResponseCookieInfo.RSAApiKey, ResponseCookieInfo.RSASysKey, GovtAdmin }, 1, RetrunMessge.SUCCESS, HttpCode.Success));
             }
             else if (!Code.ToUpper().Equals(Param.ValidateCode.Trim().ToUpper()))
             {
                 return(ObjectResultEx.Instance(null, -1, "验证码错误", HttpCode.NoAuth));
             }
             else
             {
                 return(ObjectResultEx.Instance(null, -1, "登录失败或账户冻结", HttpCode.NoAuth));
             }
         }
         else
         {
             if (GovtAdmin != null)
             {
                 CookieInfo cookie = new CookieInfo();
                 VerificationExtension.WriteToken(cookie, GovtAdmin);
                 return(ObjectResultEx.Instance(new { ResponseCookieInfo.RSAToKen, ResponseCookieInfo.RSAApiKey, ResponseCookieInfo.RSASysKey, GovtAdmin }, 1, RetrunMessge.SUCCESS, HttpCode.Success));
             }
             else if (GovtAdmin == null)
             {
                 return(ObjectResultEx.Instance(null, -1, "请检查用户名和密码是否正确", HttpCode.NoAuth));
             }
             else if (!Code.ToUpper().Equals(Param.ValidateCode.Trim().ToUpper()))
             {
                 return(ObjectResultEx.Instance(null, -1, "验证码错误", HttpCode.NoAuth));
             }
             else
             {
                 return(ObjectResultEx.Instance(null, -1, "登录失败或账户冻结", HttpCode.NoAuth));
             }
         }
     }
     catch (Exception)
     {
         return(ObjectResultEx.Instance(null, -1, "请输入验证码", HttpCode.FAIL));
     }
 }
Exemplo n.º 3
0
 public ObjectResultEx Login(RequestGovtInfo Param)
 {
     try
     {
         var    GovtAdmin = GovtWebService.GovtLogin(Param);
         string Code      = string.Empty;
         if (GovtAdmin != null)
         {
             CookieInfo cookie = new CookieInfo();
             VerificationExtension.WriteToken(cookie, GovtAdmin);
             return(ObjectResultEx.Instance(new { ResponseCookieInfo.RSAToKen, ResponseCookieInfo.RSAApiKey, ResponseCookieInfo.RSASysKey, GovtAdmin }, 1, RetrunMessge.SUCCESS, HttpCode.Success));
         }
         else
         {
             return(ObjectResultEx.Instance(null, -1, "登录失败或账户冻结", HttpCode.NoAuth));
         }
     }
     catch (Exception)
     {
         return(ObjectResultEx.Instance(null, -1, "请检查账号和密码是否正确", HttpCode.FAIL));
     }
 }
Exemplo n.º 4
0
 public ObjectResultEx EditUser(RequestGovtInfo Param)
 {
     return(ObjectResultEx.Instance(GovtWebService.EditUser(Param), 1, RetrunMessge.SUCCESS, HttpCode.Success));
 }
Exemplo n.º 5
0
 public ObjectResultEx PushInfo(RequestGovtInfo Param)
 {
     return(ObjectResultEx.Instance(GovtService.PushInfo(Param), 1, RetrunMessge.SUCCESS, HttpCode.Success));
 }
Exemplo n.º 6
0
        /// <summary>
        /// 推送账号
        /// </summary>
        /// <param name="Param"></param>
        /// <returns></returns>
        public string PushInfo(RequestGovtInfo Param)
        {
            GovtInfo Info = Param.MapToEntity <GovtInfo>();

            return(Insert(Info) ? ServiceMessage.INSERTSUCCESS : ServiceMessage.INSERTFAIL);
        }