| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { ResponseCode } from '@12333/constants'; |
| | | import * as authServices from '@12333/services/apiV2/auth'; |
| | | import { APP_ENV } from '@/constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'registerForm', |
| | |
| | | }); |
| | | |
| | | async function onGetCaptcha() { |
| | | await authServices.sendLoginOrRegisterVerifyCode( |
| | | const res = await authServices.sendLoginOrRegisterVerifyCode( |
| | | { |
| | | phoneNumber: form.phoneNumber, |
| | | }, |
| | | { |
| | | showLoading: false, |
| | | getResponse: true, |
| | | // customErrorHandler(error) { |
| | | // if (error?.response?.data?.error?.code === ResponseCode.RegisterExistsPhoneNumber) { |
| | | // Message.confirm({ |
| | |
| | | // }, |
| | | } |
| | | ); |
| | | |
| | | if (res && APP_ENV === 'staging') { |
| | | // @ts-ignore |
| | | form.verificationCode = res?.data?.extras?.code ?? ''; |
| | | } |
| | | } |
| | | |
| | | async function handleRegister() { |