public ComRet Register(string account, string password, LoginType origin) { if (MongoEntity.Exists <Passport>(p => p.Account == account)) { return(Result("账户名已存在")); } var passport = new Passport(account, password, origin); passport.SecurityKey = string.Format("{0}{1}{2}{3}{4}", passport.Id, passport.Account, passport.BsonObjectId.CreationTime.ToString("yyyyMMddHHmmss"), passport.BsonObjectId.Pid, passport.BsonObjectId.Timestamp).ToMD5(); //SecurityManager.Instance.GenSecurityKey(account, passport.Id); passport.Save(); return(Result(true, passport.Id)); }
public ComRet Register(string passportid, string account, string name, string email) { if (MongoEntity.Exists <Profile>(p => p.Account == account)) { return(Result("账户名称已存在")); } var profile = new Profile() { Id = passportid, Account = account, Name = name, Email = email }; profile.SecurityKey = string.Format("{0}{1}{2}{3}{4}", profile.Id, profile.Account, profile.BsonObjectId.CreationTime.ToString("yyyyMMddHHmmss"), profile.BsonObjectId.Pid, profile.BsonObjectId.Timestamp).ToMD5(); //SecurityManager.Instance.GenSecurityKey(account, passport.Id); profile.Save(); return(Result(true, profile.Id)); }
public ComRet Register(string account, string password) { if (MongoEntity.Exists <Passport>(p => p.Account == account)) { return(Result(false, "账户已存在")); } Passport passport = new Passport(account, password); passport.Save(); Profile profile = new Profile() { Account = passport.Account, Name = account }; profile.Save(); return(Result(true)); }
public ComRet CheckTicket(string ticket) { return(Result(MongoEntity.Exists <Passport>(p => p.Ticket == ticket))); }
public virtual bool Exists(Expression <Func <T, bool> > where) { return(MongoEntity.Exists <T>(where)); }
public virtual bool Exists(string id) { return(MongoEntity.Exists <T>(id)); }