From 5ede115cf91ab6d632d39623ad8b283664af2916 Mon Sep 17 00:00:00 2001 From: xuesinan <1404152492@qq.com> Date: Wed, 12 Jan 2022 17:47:04 +0800 Subject: [PATCH 01/10] =?UTF-8?q?test:=20=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++ hooks/user/userMixin.js | 24 +++++++------- pages/user/login.vue | 69 +++++++++++++++++++++++------------------ 3 files changed, 54 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 720d2ba..62d068e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 范围|描述|commitId --|--|-- - | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e) + - | 插件面板分开显示 | [fb5e86b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/fb5e86b) - | 更新代码 | [392c8cc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/392c8cc) - | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6) - | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91) @@ -55,6 +56,8 @@ - | 更新drone.yml | [a57d598](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a57d598) - | 添加drone.yml | [9fbae89](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9fbae89) - | 修改.drone.yml | [f5b52e3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f5b52e3) + - | ci update | [d38262e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d38262e) + - | drone | [8cddc7b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8cddc7b) ### 🔨 代码重构 diff --git a/hooks/user/userMixin.js b/hooks/user/userMixin.js index 30e9b56..79d179f 100644 --- a/hooks/user/userMixin.js +++ b/hooks/user/userMixin.js @@ -1,6 +1,5 @@ import { ref, computed, reactive } from 'vue'; -import { useStore } from 'vuex'; -import { onReady } from '@dcloudio/uni-app'; +import { useStore } from 'vuex'; import clipboard from "@/common/js/dc-clipboard/clipboard.js"; import Config from '@/common/js/config.js' @@ -88,12 +87,12 @@ export default function userMixin() { // const showPaste = ref(false); const dataObj = reactive({ showInterval: false, - interval: 120, + interval: 60, showPaste: false - }) + }); //有图片验证码的值 - function hasvalue(form) { + function hasvalue(form, renderData) { if(form.smsCode || form.showPaste) return if (!verifyPhone(form.phone)) { uni.$ui.showToast('请输入正确的手机号'); @@ -103,26 +102,29 @@ export default function userMixin() { uni.$ui.showToast('请输入图形验证码'); return; } - getCode(form); + + if (!dataObj.showInterval) { + getCode(form, renderData); + } } // 获取验证码 - async function getCode(form) { + async function getCode(form, renderData) { try { - if (!form.verificationCodeId || !form.verificationCodeValue) { + if (!renderData.verificationCodeId || !form.verificationCodeValue) { uni.$ui.showToast('缺少图形验证码参数'); return; } const params = { phone: form.phone, - verificationCodeId: form.verificationCodeId, + verificationCodeId: renderData.verificationCodeId, verificationCodeValue: form.verificationCodeValue, }; const date = await store.dispatch('user/sendCode', params); getCodeInterval(); dataObj.showPaste = true; } catch (err) { - getImageCode(); + dataObj.showPaste = false; throw err; } } @@ -135,7 +137,7 @@ export default function userMixin() { clearInterval(codeTimer.value); codeTimer.value = null; dataObj.showInterval = false; - dataObj.interval = 120; + dataObj.interval = 60; return; } dataObj.interval = dataObj.interval - 1; diff --git a/pages/user/login.vue b/pages/user/login.vue index 2c904c5..9e48f86 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -1,17 +1,17 @@