wx.miniapp.login

跳转微信获取微信登录态

注:

1、该接口需要申请和初始化微信 open 能力,需要客户端进行相关配置

2、该接口不支持在「移动应用助手」中调试,开发者需构建 apk 或者 ipa 安装到手机后才能调试

接入前注意事项

参数

属性类型默认值必填说明
successfunction获取后成功回调

JSAPI 代码例子

// login
wx.miniapp.login({
    success: (res) => {
        console.log('login success:', res.code)
    }
})