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) {