You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
682 B
24 lines
682 B
#include"account.h"
|
|
|
|
Authenticator::Authenticator(){
|
|
users = {
|
|
User("张三1","123","小学"),
|
|
User("张三2","123","小学"),
|
|
User("张三3","123","小学"),
|
|
User("李四1","123","初中"),
|
|
User("李四2","123","初中"),
|
|
User("李四3","123","初中"),
|
|
User("王五1","123","高中"),
|
|
User("王五2","123","高中"),
|
|
User("王五3","123","高中"),
|
|
};
|
|
}
|
|
|
|
User* Authenticator::authenticate(const std::string& username,const std::string& password){
|
|
for(User& user : users){
|
|
if(user.UserName == username&&user.Password == password){
|
|
return &user;
|
|
}
|
|
}
|
|
return nullptr;
|
|
} |