Esempio n. 1
0
        private BaseModel ClientValidateToken(string token)
        {
            #region 非数据库端验证token
            if (ValidateHelper.IsNullOrEmpty(token))
            {
                return(new BaseModel()
                {
                    Code = (int)CodeEnum.Token不能为空, Msg = CodeMsgDAL.GetByCode((int)CodeEnum.Token不能为空)
                });
            }
            if (!ValidateHelper.Guid(token))
            {
                return(new BaseModel()
                {
                    Code = (int)CodeEnum.Token格式错误, Msg = CodeMsgDAL.GetByCode((int)CodeEnum.Token格式错误)
                });
            }
            #endregion

            return(new BaseModel()
            {
                Code = (int)CodeEnum.成功, Msg = string.Format(CodeMsgDAL.GetByCode((int)CodeEnum.成功), "成功")
            });
        }
Esempio n. 2
0
        private BaseModel ClientValidateUnionUserId(string unionUserId)
        {
            #region 非数据库端验证unionUserId
            if (ValidateHelper.IsNullOrEmpty(unionUserId))
            {
                return(new BaseModel()
                {
                    Code = (int)CodeEnum.UnionUserId不能为空, Msg = CodeMsgDAL.GetByCode((int)CodeEnum.UnionUserId不能为空)
                });
            }
            if (!ValidateHelper.Guid(unionUserId))
            {
                return(new BaseModel()
                {
                    Code = (int)CodeEnum.UnionUserId格式错误, Msg = CodeMsgDAL.GetByCode((int)CodeEnum.UnionUserId格式错误)
                });
            }
            #endregion

            return(new BaseModel()
            {
                Code = (int)CodeEnum.成功, Msg = string.Format(CodeMsgDAL.GetByCode((int)CodeEnum.成功), "成功")
            });
        }