javascript - Third-party login form design
阿神
阿神 2017-05-16 13:07:27
0
2
436

1. You can register and log in with your mobile phone number.
2. You can log in as a third party through WeChat, QQ, and Weibo.
3. Users can bind their mobile phone numbers, WeChat, QQ, and Weibo, that is, they can bind each other.
In this case, a user is likely to have 1-4 accounts, but later the third-party login account can be bound to any other account. This will lead to the situation of which user ID is used when logging in.
Do you have any good solutions for the user table structure design in this situation?

阿神
阿神

闭关修行中......

reply all(2)
黄舟

Recommend Liao Xuefeng’s design of an scalable user login system
You can read the question, it should be helpful to you

曾经蜡笔没有小新

It is certain to have a main user table. The three-party login information needs to be stored in another table, a separate table for each three-party interface. (If the data returned by the three-party interface is similar, you can consider putting it in one table) There will be a uid field in the three-party login table that is associated with the main user table.
After the third party logs in, check whether there is relevant data in the third party table. If not, register or bind it. This needs to be operated according to your logic. If the data is found, log in.

Then you mentioned the problem of secondary binding of third-party accounts. You will be prompted directly that it has been bound and you need to unbind it before you can bind it again and that’s it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template