feat: 新增微信小程序登录功能及第三方账号绑定表

This commit is contained in:
Ray.Hao
2026-03-05 07:45:01 +08:00
parent 9d117ce884
commit 27a8f0e6a5
40 changed files with 1643 additions and 164 deletions

View File

@@ -10,7 +10,7 @@ CREATE DATABASE IF NOT EXISTS youlai_admin CHARACTER SET utf8mb4 DEFAULT COLLATE
-- ----------------------------
-- 2. 创建表 && 数据初始化
-- 2. 创建表 && 数据初始化
-- ----------------------------
USE youlai_admin;
@@ -557,3 +557,25 @@ INSERT INTO `sys_user_notice` VALUES (7, 7, 2, 1, NULL, now(), now(), 0);
INSERT INTO `sys_user_notice` VALUES (8, 8, 2, 1, NULL, now(), now(), 0);
INSERT INTO `sys_user_notice` VALUES (9, 9, 2, 1, NULL, now(), now(), 0);
INSERT INTO `sys_user_notice` VALUES (10, 10, 2, 1, NULL, now(), now(), 0);
-- ----------------------------
-- Table structure for sys_user_social
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_social`;
CREATE TABLE `sys_user_social` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`user_id` bigint NOT NULL COMMENT '用户ID',
`platform` varchar(20) NOT NULL COMMENT '平台类型(WECHAT_MINI/WECHAT_MP/ALIPAY/QQ/APPLE)',
`openid` varchar(64) NOT NULL COMMENT '平台openid',
`unionid` varchar(64) DEFAULT NULL COMMENT '微信unionid',
`nickname` varchar(64) DEFAULT NULL COMMENT '第三方昵称',
`avatar` varchar(255) DEFAULT NULL COMMENT '第三方头像URL',
`session_key` varchar(128) DEFAULT NULL COMMENT '微信session_key',
`verified` tinyint(1) DEFAULT 1 COMMENT '是否已验证(1-已验证 0-未验证)',
`create_time` datetime DEFAULT NULL COMMENT '绑定时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_platform_openid` (`platform`, `openid`),
KEY `idx_user_id` (`user_id`),
KEY `idx_unionid` (`unionid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户第三方账号绑定表';