diff --git a/pages/API/unicloud-database/unicloud-database.uvue b/pages/API/unicloud-database/unicloud-database.uvue index 3863f25ad80291ade291f70caa3bcba19527dd22..f37730e2ee561ff5eab5fe85bc0cd33da99b4733 100644 --- a/pages/API/unicloud-database/unicloud-database.uvue +++ b/pages/API/unicloud-database/unicloud-database.uvue @@ -280,19 +280,19 @@ const error = err as UniCloudError this.notify(error.errMsg, '错误') }) - }, - async dbMultiSend() { - const db = uniCloud.databaseForJQL() - const temp1 = db.collection('type') - .where( - 'tag == "default-tag"' - ).getTemp() - const temp2 = db.collection('type') - .where( - 'tag == "default-tag"' - ).getTemp() - await db.multiSend(temp1, temp2) - .then(res => { + }, + async dbMultiSend() : Promise { + const db = uniCloud.databaseForJQL() + const temp1 = db.collection('type') + .where( + 'tag == "default-tag"' + ).getTemp() + const temp2 = db.collection('type') + .where( + 'tag == "default-tag"' + ).getTemp() + await db.multiSend(temp1, temp2) + .then(res => { uni.hideLoading() let successCount = 0 for (let i = 0; i < res.dataList.length; i++) { @@ -305,14 +305,14 @@ } } this.multiSendSuccessCount = successCount - this.notify(`合并查询成功,成功查询的语句条数为:${successCount}`, '提示') - }) - .catch((err : any | null) => { - uni.hideLoading() + this.notify(`合并查询成功,成功查询的语句条数为:${successCount}`, '提示') + }) + .catch((err : any | null) => { + uni.hideLoading() const error = err as UniCloudError console.error(err) - this.notify(error.errMsg, '错误') - }) + this.notify(error.errMsg, '错误') + }) } } }