es6 Promise.all 用法

init() {

this.pageLoading = true;

Promise.all(this.getTime(), this.getAddress())

.then((time, host) => {

this.loading= false;

this.form.time= time;

this.form.host = host;

})

.catch(() => {

this.loding= false;

});

},

getTime() {

return this.$post("/query");

},

// 查询上次时间同步的地址

getAddress() {

return this.$post("/del");

},

mounted() {

this.init()

},

相关推荐
AIFQuant4 分钟前
贵金属投资 APP 开发:实时报价、图表、提醒与交易数据全链路
开发语言·前端·websocket·金融·web app
爱吃羊的老虎6 分钟前
【JAVA】python转java:Spring Boot 如何处理 Web 请求
java·前端·spring boot·http
shuoshuohaohao6 分钟前
《JavaScript》
开发语言·前端·javascript
步步为营DotNet11 分钟前
洞悉.NET 11:ASP.NET Core 10 在构建实时协作 Web 应用的技术实践
前端·asp.net·.net
Bigger13 分钟前
mini-cc 的技能系统:给 AI 装上“专业外挂”
前端·ai编程·claude
繁星星繁15 分钟前
LangChain 初探:模型调用、链式编排与运行机制
前端·chrome·langchain
z2005093016 分钟前
【linux学习】Linux 软硬链接深度解析:从 inode 到目录硬链接的那些坑
前端·chrome
编程猪猪侠21 分钟前
基于uni-app-x 与 uni-app 的安卓与 H5 双向通信完整实现
android·javascript·uni-app
competes23 分钟前
数据查询方式最左匹配原则
java·大数据·前端·人工智能·windows