f
This commit is contained in:
@@ -35,7 +35,8 @@
|
||||
<input v-model="formData.mobile" id="mobile" type="tel" placeholder="请输入手机号"
|
||||
class="flex-1 border-none outline-none" @click="handleInputClick" />
|
||||
</div>
|
||||
<div class="flex items-center py-3 border-b border-gray-100">
|
||||
<!-- 小微企业(companyinfo)暂不展示验证码 -->
|
||||
<div v-if="needVerificationCode" class="flex items-center py-3 border-b border-gray-100">
|
||||
<label for="verificationCode" class="w-20 font-medium text-gray-700">验证码</label>
|
||||
<input v-model="formData.verificationCode" id="verificationCode" placeholder="请输入验证码"
|
||||
maxlength="6" class="flex-1 border-none outline-none" @click="handleInputClick" />
|
||||
@@ -382,6 +383,9 @@ const isPhoneNumberValid = computed(() => {
|
||||
|
||||
const isIdCardValid = computed(() => /^\d{17}[\dX]$/i.test(formData.idCard));
|
||||
|
||||
// 小微企业(companyinfo)暂不需要验证码
|
||||
const needVerificationCode = computed(() => props.feature !== 'companyinfo');
|
||||
|
||||
const isLoggedIn = computed(() => userStore.isLoggedIn);
|
||||
|
||||
const buttonText = computed(() => {
|
||||
@@ -568,12 +572,13 @@ function handleSubmit() {
|
||||
(v) => isIdCardValid.value,
|
||||
"请输入有效的身份证号码"
|
||||
) ||
|
||||
!validateField(
|
||||
"verificationCode",
|
||||
formData.verificationCode,
|
||||
(v) => v,
|
||||
"请输入验证码"
|
||||
)
|
||||
(needVerificationCode.value &&
|
||||
!validateField(
|
||||
"verificationCode",
|
||||
formData.verificationCode,
|
||||
(v) => v,
|
||||
"请输入验证码"
|
||||
))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -591,9 +596,11 @@ async function submitRequest() {
|
||||
const req = {
|
||||
name: formData.name,
|
||||
id_card: formData.idCard,
|
||||
mobile: formData.mobile,
|
||||
code: formData.verificationCode
|
||||
mobile: formData.mobile
|
||||
};
|
||||
if (needVerificationCode.value) {
|
||||
req.code = formData.verificationCode;
|
||||
}
|
||||
const reqStr = JSON.stringify(req);
|
||||
const encodeData = aesEncrypt(reqStr, "ff83609b2b24fc73196aac3d3dfb874f");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user