Loading…

Byte applet login

First, you need to use the login api of `byte applet` to obtain the temporary `code` of the current user, and then use the code to log in: ["Toutiao Mini Program Login API Instructions"](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/log-in/tt-login) After getting the `code`, complete the login: ```javascript WXAPI.login_tt(code) ``` + code The user temporary code of the byte applet obtained in the previous step ```json { "code": 0, "data": { "uid": 2101167, "openid": "ccc11f02-e98a-4098-9672-1f000f890b51", "token": "2c4c04cc-91f8-4643-a51e-775fde4a3448" }, "msg": "success" } ``` + uid After successful login, return the user number + openid is the openid of the current byte user corresponding to the current applet + mobile is the current user’s mobile phone number + token is the token returned after the user logs in. Many subsequent user-related operations require the token to be operated.