Loading…

WeChat Mini Program binds mobile phone number

According to the official WeChat Mini Program documentation, when the user clicks the button, the user's encrypted mobile phone number data is obtained, and then this interface is called to complete the binding of the user's mobile phone number: ["Get the user's WeChat mobile phone number"](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html) ```javascript WXAPI.bindMobileWxappV2(token, code, pwd) ``` + token the current user’s login credentials + code The code returned after clicking the button, see [https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html) + pwd This parameter is optional. If passed, the user's login password will be set at the same time, and then the user can log in using the mobile phone number + password method. ```json { "code": 0, "data": "13500000000", "msg": "success" } ``` + data synchronously returns the bound mobile phone number