From 69294377a364b32f926729075f65bcf9430e7478 Mon Sep 17 00:00:00 2001 From: leiyun Date: Sat, 28 Mar 2026 17:06:28 +0800 Subject: [PATCH] =?UTF-8?q?save=20=20=E5=A4=84=E7=90=86=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=82=A3=E8=80=85=E9=AA=8C=E8=AF=81=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/mp.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controller/mp.js b/src/controller/mp.js index 4c7f0b9..f580932 100644 --- a/src/controller/mp.js +++ b/src/controller/mp.js @@ -233,10 +233,13 @@ module.exports = class extends Base { if (!idCardBack) return this.json({ code: 1, msg: '请上传证件反面照片' }); } if (!mobile || !/^1[3-9]\d{9}$/.test(mobile)) return this.json({ code: 1, msg: '请输入正确的手机号' }); - if (!code || !/^\d{6}$/.test(code)) return this.json({ code: 1, msg: '请输入6位验证码' }); - const verifyResult = await this.verifySmsCode(mobile, 'real_name_auth', code); - if (!verifyResult.success) return this.json({ code: 1, msg: verifyResult.message }); + // 确认绑定时跳过验证码校验(第一次提交时已校验过) + if (!confirmBind) { + if (!code || !/^\d{6}$/.test(code)) return this.json({ code: 1, msg: '请输入6位验证码' }); + const verifyResult = await this.verifySmsCode(mobile, 'real_name_auth', code); + if (!verifyResult.success) return this.json({ code: 1, msg: verifyResult.message }); + } const patientModel = this.model('patient'); const userModel = this.model('wechat_user');