Loading…

User authorization registration and management

# Pop up user authorization information Check out Toutiao API interface documentation [https://microapp.bytedance.com/dev/cn/mini-app/develop/open-capacity/log-in/tt.login](https://microapp.bytedance.com/dev/cn/mini-app/develop/open-capacity/log-in/tt.login) Use the following 2 interfaces: ## tt.login interface to obtain code **Sample code:** ```javascript tt.login({ success(res) { console.log(`Login call successful ${res.code} ${res.anonymousCode}`); }, fail(res) { console.log(`login call failed`); } }); ``` ## tt.getUserInfo interface to obtain user information **Sample code:** ```javascript tt.getUserInfo({ success(res) { console.log(`getUserInfo called successfully ${res.userInfo}`); }, fail(res) { console.log(`getUserInfo call failed`); } }); ``` ## # Cloud development completed registration ```javascript TTAPI.register_tt({ code: code, avatarUrl: res.userInfo.avatarUrl, nickName: res.userInfo.nickName, province: res.userInfo.province, city: res.userInfo.city, }).then(apiResult => { console.log(apiResult); //Register interface return data }) ``` # View and manage users in the cloud background ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1577855011962-a775d18a-5bc4-4ca4-baca-2ccdc77db6db.png)