9:41 kanliAI

WeChat Auth

微信 openId 获取

调用微信登录接口获取临时 code,交换 openId 并写入用户信息。

uni.login({ provider: 'weixin' }) → code

GET /weixin/jscode2session?code=xxxx → { session_key, openid }

userStore.setUserInfo({ openid })

wx 的 openid:

oYb4P0-U3dL0yJ3s6Q9aP3L8

WxLogin 组件

用于进一步验证,实际项目中为独立组件。原型中展示挂载占位。

WxLogin Component Placeholder