wupengfei
5 天以前 037fb36aaf4123ef143ac48038a0b171418a20e5
apps/bMiniApp/src/subpackages/login/registerForm/registerForm.vue
@@ -54,7 +54,6 @@
<script setup lang="ts">
import LoginPageLayout from '../components/LoginPageLayout/LoginPageLayout.vue';
import { Policy } from '@/components';
import * as commonServices from '@12333/services/api/Common';
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
import { FormValidator, Message } from '@12333/utils';
import { LargeButton } from '@/components';
@@ -62,7 +61,7 @@
import { VerificationCodeBusinessType } from '@12333/constants';
import Taro from '@tarojs/taro';
import { ResponseCode } from '@12333/constants';
import * as accountServices from '@12333/services/api/Account';
import * as authServices from '@12333/services/apiV2/auth';
defineOptions({
  name: 'registerForm',
@@ -89,24 +88,23 @@
});
async function onGetCaptcha() {
  await commonServices.sendVerificationCode(
  await authServices.sendLoginOrRegisterVerifyCode(
    {
      phoneNumber: form.phoneNumber,
      businessType: VerificationCodeBusinessType.PhoneMesssageCodeRegister,
    },
    {
      showLoading: false,
      customErrorHandler(error) {
        if (error?.response?.data?.error?.code === ResponseCode.RegisterExistsPhoneNumber) {
          Message.confirm({
            message: '该手机号已注册,请去登录页登录',
            confirmText: '去登录',
          }).then(() => {
            goLogin();
          });
          return true;
        }
      },
      // customErrorHandler(error) {
      //   if (error?.response?.data?.error?.code === ResponseCode.RegisterExistsPhoneNumber) {
      //     Message.confirm({
      //       message: '该手机号已注册,请去登录页登录',
      //       confirmText: '去登录',
      //     }).then(() => {
      //       goLogin();
      //     });
      //     return true;
      //   }
      // },
    }
  );
}