Design of user login system

there is such a requirement:
user login module, does not support the choice of login method, only a text input box, while supporting: QQ number, mobile number, e-mail, nickname, ID card, etc. (if the user filled in the values of these five fields) any field + password combination to log in, is there a good way to achieve it?


is not much different from ordinary login.
maybe one more step is added
when you log in at the front desk, you must choose the login method, right?
then your default login method has at least five options: QQ number , Mobile number , email , nickname , ID . You can only choose one of the
fields such as qq phone email email nike_name card .

if third-party login is involved, add a user third-party table to store information related to third-party login, such as QQ, Weibo, Wechat, etc., and set the corresponding table fields according to the interface and business.

For

qq, you need to connect to the Tencent interface. For others, you can register first, store it in the database, and then compare it. This is my idea


although this requirement is a little strange, if you want to solve the problem gracefully:
1, the newly created table user_security contains two fields user_id,ideneity (although you don't know why there is no password).
2. When new users are added, 5 records are added to the user_security table (QQ number, mobile number, email, nickname, ID card and user_id, respectively).
3. When authenticating, you only need to find the login name entered by the user to match.
4. By the way, remember to index.


it is recommended to use a basic table and multiple sub-tables to build, that is, the basic table is logged in by user_base,QQ and user_qq, and so on


will conflict. What if someone's nickname is the same as someone else's QQ number?
this is not unique in itself and unrealistic.


the design of your table is easy in business;
it is important to distinguish the rules of each field to ensure uniqueness. At the very least, you can't have user A's account number, which is the same as user B's mobile phone number.


this kind of requirement, I think it's only unique to restrict his password when he registers. When he enters his account password, he only takes the password to the database to find out the QQ number, mobile phone number, email, nickname, ID card and other information, and then make a comparison!


QQ number: 5 to 10 digits
11 digits starting with 1, and can also be restricted by the first three digit fields
email: must have @ and one. Add the suffix ending
nickname: limit and other different
ID card: it must be 15 or 18 digits and finally it can be x listing rules, then analyze, simply judge, you match five fields, then the nickname should be limited


bizarre requirements!

Menu