# wx.miniapp.login

Jump WeChat to get WeChat login status

Note:

1, the interface needs to apply and initialize WeChat open Capabilities, requires the client to configure the relevant

2, the interface does not support theMobile App AssistantDebugging, developers need to build Apk or ipa Install to the phone before debugging

# Precautions before Access

  • This ability dependsWeChat Open SDK , need to follow the guidelines in theWeChat Open PlatformCreate a mobile application account to complete the relevant initialization configuration, details can be viewedWeChat mobile application capability initialization guidelines
  • The interface's underlying scope yes snsapi_userinfo , obtained through the interface Code You can then call [/Sns/oauth2/access_Token](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Log in/Development_Guide.html) Interface acquisition access_Token , can be accessed by [/Sns/userinfo](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Log in/Development_Guide.html) Interface to obtain user information.
  • Note: Generating access_Token of appid and secret It's a mobile app account on WeChat's open platform. appid and secret

# parameter

attribute type Default value Required Introductions
success function yes Successful callback after getting

# JSAPI Examples of code

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