Skip to content

Commit

Permalink
fix: use promise all to process multiple asynchronous requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mitian233 committed Aug 23, 2023
1 parent 7bc8fb8 commit 2ca6862
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions web/src/components/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -292,22 +292,14 @@ export default {
});
},
delete_records() {
axios
.delete(
"https://www.diving-fish.com/api/maimaidxprober/player/delete_records"
)
.then((resp) => {
this.$message.success("已删除舞萌查分器" + resp.data.message + "条数据");
setTimeout("window.location.reload()", 1500);
});
axios
.delete(
"https://www.diving-fish.com/api/chunithmprober/player/delete_records"
)
.then((resp) => {
this.$message.success("已删除中二节奏查分器" + resp.data.message + "条数据");
setTimeout("window.location.reload()", 1500);
});
axios.all([
axios.delete("https://www.diving-fish.com/api/maimaidxprober/player/delete_records"),
axios.delete("https://www.diving-fish.com/api/chunithmprober/player/delete_records")
]).then(axios.spread((maimaiResp,chuniResp)=>{
this.$message.success("已删除舞萌查分器" + maimaiResp.data.message + "条数据");
this.$message.success("已删除中二节奏查分器" + chuniResp.data.message + "条数据");
setTimeout("window.location.reload()", 1500);
}));
},
change_password() {
if (!this.$refs.changePasswordForm.validate()) return;
Expand Down

0 comments on commit 2ca6862

Please sign in to comment.