Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to design the login registration of multiple social accounts in mysql

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to design the login registration of multiple mysql social accounts". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to design the login registration of multiple mysql social accounts".

What are the open platforms?

WeChat

Sina Weibo

QQ

one hundred and sixty three

three hundred and sixty

Douban

Taobao

Github

Open source China

Others.

User registration logic

Parameters.

(username) user name

(password) password

(platform_id) platform ID

(code) CAPTCHA

Verify the validity of the data.

Determine whether the user name exists in the user table.

If present, guide the user to log in.

If it does not exist, execute the registration procedure.

Password encryption rules (reference: encryption technology and key security management)

User login logic

General login:

Parameters.

(username) user name

(password) password

(platform_id) platform ID

(code) CAPTCHA

Verify the validity of the data.

Determine whether user data exists in the user table.

Keep a log.

Log in to social account (parameters):

Parameters.

(platform_id) platform ID

(channel_id) Channel ID

(open_id) Open ID on social platform

Verify the validity of the data.

Determine whether the data for the openid exists in the user_social table.

If it exists, log in directly.

If it does not exist, store the data in the user_social table and guide the user to bind the local account.

If an account already exists on this site, it can be directly associated with the account.

If there is no account on this site, guide the user to register and associate with the current openid after success.

Keep a log

Data table structure

User account table

CREATE TABLE `user` (`id` int (11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'key ID', `username` varchar (80) NOT NULL DEFAULT' 'COMMENT' username', `password` char (60) NOT NULL DEFAULT''COMMENT' password', `password` tinyint (1) unsigned NOT NULL DEFAULT'0' COMMENT 'platform ID', `create_ time`timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'creation time', PRIMARY KEY (`id`) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' user account table'

User social account table

CREATE TABLE 'user_ social` (`id` int (11) unsigned NOT NULL AUTO_INCREMENT COMMENT' key ID', `uid` int (11) unsigned NOT NULL DEFAULT'0' COMMENT 'user ID', `open_ id` varchar' 'COMMENT' social platform open ID', `platform_ id` tinyint (1) unsigned NOT NULL DEFAULT'0' COMMENT 'platform ID `update_ time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'creation time', `update_ time` timestamp NOT NULL DEFAULT '0000-00-0000: 00update_ 00' COMMENT' update time', PRIMARY KEY (`id`), KEY `idx_ uid` (`uid`) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' user social account table'

User login log table

CREATE TABLE `platform_ log` (`id`int (11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'key ID', `uid` int (11) unsigned NOT NULL DEFAULT' 0' COMMENT 'user ID', `platform_ id`tinyint (1) unsigned NOT NULL DEFAULT' 0' COMMENT 'platform ID', `channel_ id`tinyint (1) unsigned NOT NULL DEFAULT'0' COMMENT 'channel ID (1million QQ repertoire 2 years SinaWeibojing 3mm Weixin)', `create_ time`timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'creation time' PRIMARY KEY (`id`) KEY `idx_ uid` (`uid`) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' user login log table' Thank you for your reading, the above is the content of "how to design the login registration of multiple social accounts in mysql". After the study of this article, I believe you have a deeper understanding of how to design the login registration of multiple social accounts in mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report