From 0cc4dc3ec537d705a556306ef1637945d2a8c9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sun, 4 May 2025 14:19:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0lint=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E5=92=8C=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=91=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8F=98=E9=87=8F=E5=90=8D=E4=BB=A5=E6=8F=90?= =?UTF-8?q?=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .lintstagedrc.json | 11 ++++++++--- package.json | 1 + pages/addDevice/distributionNetwork.vue | 11 ++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 3ae556d..ed2a987 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,9 @@ { - "src/**/*.{vue,js}": ["npm run prettier", "npm run eslint"], - "src/**/*.{vue,scss,css,less}": ["npm run stylelint:out"] -} + "*.{vue,js}": [ + "prettier --write", + "eslint --fix" + ], + "*.{vue,scss,css,less}": [ + "stylelint --fix" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 51c700d..5a12c60 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "vite-plugin-eslint": "^1.8.1" }, "scripts": { + "prepare": "husky install", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss}\"", "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,vue,json,css,scss}\"", "lint": "eslint --fix \"**/*.{js,jsx,ts,tsx,vue}\"", diff --git a/pages/addDevice/distributionNetwork.vue b/pages/addDevice/distributionNetwork.vue index 6c96deb..2290a35 100644 --- a/pages/addDevice/distributionNetwork.vue +++ b/pages/addDevice/distributionNetwork.vue @@ -77,11 +77,12 @@ const pending = ref(false) - const result = ref(false) + const requestResult = ref(false) onMounted(async () => { uni.showLoading({ - title: '搜索中' + title: '搜索中', + mask: true }) const result = await $bluetooth.getWifiList({ uid: $user.userInfo.uid.toString() @@ -124,7 +125,7 @@ } }) uni.$on('distributionNetworkResult', async data => { - result.value = false + requestResult.value = false uni.hideLoading() pending.value = false if (data.status === 0) { @@ -190,10 +191,10 @@ }) if (res.code === 0) { - result.value = true + requestResult.value = true setTimeout(() => { pending.value = false - if (result.value) { + if (requestResult.value) { uni.showToast({ title: '配网失败,请检查密码是否正确', icon: 'none'