zhuanghaixin / Interview

8 stars 0 forks source link

分批请求 #219

Open zhuanghaixin opened 2 years ago

zhuanghaixin commented 2 years ago
                   let groupArr = _.chunk(wxUINList, 10);
                                console.log('groupArr', groupArr);

                                let batchFormData = {};
                                batchFormData.act_id = actId;
                                batchFormData.withdraw_date = withdrawDate;
                                batchFormData.check_status = 1;

                                for (let i = 0; i < groupArr.length; i++) {
                                    queue.push(
                                        this.checkAnchorWithdraw({
                                            req: {
                                                wx_uin_list: groupArr[i],
                                                ...batchFormData,
                                            },
                                        })
                                    );
                                }
                                Promise.all(queue).then(res => {
                                    console.log('res==', res);
                                    let errcodeRes = _.map(res, 'error.code');
                                    if (
                                        _.uniq(errcodeRes).length === 1 &&
                                        _.uniq(errcodeRes)[0] === 0
                                    ) {
                                        tips.success('批量审核成功');
                                    } else {
                                        tips.error('有部分审核未成功');
                                    }
                                    this.refresh();
                                });