|
|
|
@@ -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'); |
|
|
|
|