【发布时间】:2022-02-22 00:31:08
【问题描述】:
我有这 4 个 api 调用
1. HttpService.PostAsync<any, any>(`post_update_ac_translates`)
2. HttpService.PostAsync<any, any>(`post_start_auto_ac_mapping`)
3. HttpService.PostAsync<any, any>(`get_std_leaf_ac_items`)
4. HttpService.PostAsync<any, any>(`get_all_ac_translates`)
我想按这个顺序执行它们
先执行1,完成时执行2,再执行2后,同时执行3和4。
我试着这样做:
concat(
HttpService.PostAsync<any, any>(`post_update_ac_translates`, {p_id: this.props.projectId, ac_trans: data}, HttpService.AuditcoreAPIBasePath),
HttpService.PostAsync<any, any>(`post_start_auto_ac_mapping`, {p_id: this.props.projectId}, HttpService.AuditcoreAPIBasePath)
).subscribe(() => {
forkJoin(
HttpService.GetAsync<any, any>(`get_std_leaf_ac_items`, {p_id: this.props.projectId}, HttpService.AuditcoreAPIBasePath),
HttpService.GetAsync<any, any>(`get_all_ac_translates`, {p_id: this.props.projectId}, HttpService.AuditcoreAPIBasePath)
).subscribe(([resp1, resp2]) => {
但是正在执行的代码有后续
1 => 3/4 => 2 => 3/4
而不是
1=> 2 => 3/4
在做
HttpService.PostAsync<any, any>(`post_update_ac_translates`, {p_id: this.props.projectId, ac_trans: data}, HttpService.AuditcoreAPIBasePath).concat(
返回错误
类型上不存在属性“concat” 'AxiosObservable'.ts(2339)
【问题讨论】:
标签: rxjs observable