["Online Walkthrough"](https://bi.cool/project/m5vDU78/embed?bi-active-file=register_username.vue)
```javascript
WXAPI.register_username({
username: '',
pwd: '',
autoLogin: true,
province: '',
city: '',
nickName: '',
postJsonString: '',
referrer: ''
})
```
+ username username
+ pwd set login password
+ autoLogin true / false Whether to automatically complete login after registration [For previously registered users, automatically complete login]
+ nickName user nickname
+ province the province where it is located
+ city city
+ postJsonString json data of user's extended attributes (requires string)
+ referrer The referrer information saved when registering this user
```json
{
"code": 0,
"data": {
"uid": 1351478,
"openid": "om3AQ0YaRp3RZtFuZ1Wgk0OdQjvA",
"mobile": "1860000062",
"token": "83065b5e-9a75-4e64-8692-4f03eaa90348"
},
"msg": "success"
}
```
+ uid After successful login, return the user number
+ 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.