Ejemplo n.º 1
0
        public ActionResult Login(CCY_Client client)
        {
            if (string.IsNullOrEmpty(client.sUnionid) || string.IsNullOrEmpty(client.sOpenId))
            {
                result.info = "参数错误";
                return(Json(result));
            }
            var procedureResult = Manager.Login(client);

            if (procedureResult.iCode == 100)
            {
                client = JsonHelper.Deserialize <CCY_Client>(JsonHelper.ToJsonString(procedureResult.sData));
                if (client.iStatus == 0)
                {
                    LoginStatus        = new ClientCacheInfo();
                    LoginStatus.ID     = client.ID;
                    LoginStatus.sToken = GuidHelper.NewGuidString();
                    RedisHelper.SetKey(RedisCacheType.ClientInfo, LoginStatus.ID, LoginStatus, 60 * 24 * 7);
                    result.code = ResultStatus.Success;
                    result.data = new
                    {
                        ID         = LoginStatus.ID,
                        sToken     = LoginStatus.sToken,
                        sNickName  = client.sNickName,
                        sPhone     = client.sPhone,
                        sHeadImg   = client.sHeadImg,
                        sWeiXinNo  = client.sWeiXinNo,
                        sPhotoName = client.sPhotoName,
                        sIntroduce = client.sIntroduce
                    };
                }
                else
                {
                    result.info = "该账号已被冻结,请联系管理员";
                }
            }
            else
            {
                result.info = "登录失败";
            }
            return(Json(result));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 微信授权登录
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public override ProcedureResult Login(CCY_Client client)
        {
            DbParameters Parameters = new DbParameters();

            Parameters.Add("@in_sNickName", client.sNickName, DbType.String);
            Parameters.Add("@in_sUnionid", client.sUnionid, DbType.String);
            Parameters.Add("@in_sOpenId", client.sOpenId, DbType.String);
            Parameters.Add("@@in_sHeadImg", client.sHeadImg, DbType.String);
            Parameters.Add("@in_code", 0, DbType.Int32, ParameterDirection.Output);
            Parameters.Add("@in_msg", null, DbType.String, ParameterDirection.Output, 100);
            var list   = query.QueryProcedure <dynamic>("ProviderSystem_ProviderUser_Login", Parameters);
            var result = new ProcedureResult();

            result.iCode = Parameters.Get <int>("in_code");
            result.sMsg  = Parameters.Get <string>("in_msg");
            if (result.iCode == 100)
            {
                result.sData = list[0];
            }
            return(result);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 微信授权登录
 /// </summary>
 /// <param name=""></param>
 /// <returns></returns>
 public abstract ProcedureResult Login(CCY_Client client);