#设置默认地址

api 接口
```
router.post("/setDefault", function(req, res, next) {
    var userId = req.cookies.userId,
        addressId = req.body.addressId;
    if (!addressId) {
        res.json({
            status: '1003',
            msg: 'addressId Is null'
        })
    } else {
        User.findOne({ userId: userId }, function(err, doc) {
            var addressList = doc.addressList;
            addressList.forEach(item => {
                if (item.addressId = addressId) {
                    item.isDefault = true;
                } else {
                    item.isDefault = false;
                }
            })

            doc.save(function(err1, doc1) {
                if (err1) {
                    res.json({
                        status: '1',
                        msg: err.message,
                        result: ''
                    })
                } else {
                    res.json({
                        status: '0',
                        msg: '',
                        result: doc1
                    })
                }
            })
        })
    }
})
```

vue 前台实现
```
setDefault(addressId){
    this.$http.post('/users/setDefault',{
    addressId:addressId
    }).then(res=>{
    if(res.data.status == '0'){
        this.getAddressList();
    }
    })
}
```