跳至主要內容
微信小程序认证

微信小程序认证

小程序认证模型

请参考手机号密码认证

@Data
public class WeChatAuth implements AuthModel {
    private String loginCode;
}

起凡2024年1月9日大约 1 分钟起凡商城微信小程序认证
微信小程序注册

微信小程序注册

后端

创建UserWeChat表

user_id作为外键关联user表。每个微信用户在每个小程序中的open_id是唯一的,所以这里使用唯一索引。

-- auto-generated definition
create table user_we_chat
(
    id           varchar(36) not null
        primary key,
    created_time datetime(6) not null,
    edited_time  datetime(6) not null,
    open_id      varchar(30) not null,
    user_id      varchar(36) not null,
    constraint user_wechat_pk
        unique (open_id)
);

起凡2024年1月9日大约 5 分钟起凡商城微信小程序注册