From 95ec088d54823ca0795910292b8b35316596385e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 6 Sep 2024 11:48:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=88=B7=E6=96=B0=E6=8F=90=E7=A4=BA=202.=20?= =?UTF-8?q?=E7=BC=A9=E7=9F=AD=E8=AF=B7=E6=B1=82=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=203.=20=E5=8E=BB=E9=99=A4=E9=87=8D=E7=BD=AE=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E7=A9=BA=E5=88=97=E8=A1=A8=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 17 ++++++++++++----- pages/passwordList/passwordList.vue | 7 ------- utils/request.js | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 8c4e93d..c2532b1 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -355,11 +355,18 @@ ...this.lockSearch, pageNo: 1 }) - await this.getLockList(this.lockSearch) - uni.showToast({ - title: '刷新成功', - icon: 'none' - }) + const { code, message } = await this.getLockList(this.lockSearch) + if(code === 0) { + uni.showToast({ + title: '刷新成功', + icon: 'none' + }) + } else { + uni.showToast({ + title: message, + icon: 'none' + }) + } this.refresherTriggered = false }, async changeSearch(data) { diff --git a/pages/passwordList/passwordList.vue b/pages/passwordList/passwordList.vue index 89410bb..6efa56f 100644 --- a/pages/passwordList/passwordList.vue +++ b/pages/passwordList/passwordList.vue @@ -167,13 +167,6 @@ export default { }, async resetPassword() { const that = this - if(this.passwordList.length === 0) { - uni.showToast({ - title: '暂无密码,无需重置', - icon: 'none' - }) - return - } uni.showModal({ title: '提示', content: '确定要重置密码,该锁的所有密码都将被删除', diff --git a/utils/request.js b/utils/request.js index 0937d71..b5abd2c 100644 --- a/utils/request.js +++ b/utils/request.js @@ -28,13 +28,13 @@ const request = (config) => { const timestamp = new Date().getTime() timer = setTimeout(() => { resolve({ code: -1, message: '网络访问失败,请检查网络是否正常' }) - }, 8000) + }, 5000) uni.request({ url: URL, method, header, data, - timeout: 7000, + timeout: 4000, async success(res) { const { statusCode, data } = res if(timer) {