| | |
| | | |
| | | <script setup lang="ts"> |
| | | import LoginPageLayout from '../components/LoginPageLayout/LoginPageLayout.vue'; |
| | | import * as commonServices from '@life-payment/services/api/Common'; |
| | | // import * as commonServices from '@life-payment/services/api/Common'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { FormValidator, Message } from '@/utils'; |
| | | import { ProFormCaptcha } from 'senin-mini/components'; |
| | |
| | | }); |
| | | |
| | | async function onGetCaptcha() { |
| | | await commonServices.sendVerificationCode( |
| | | { |
| | | 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; |
| | | } |
| | | }, |
| | | } |
| | | ); |
| | | // await commonServices.sendVerificationCode( |
| | | // { |
| | | // 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; |
| | | // } |
| | | // }, |
| | | // } |
| | | // ); |
| | | } |
| | | |
| | | async function handleRegister() { |
| | |
| | | if (state.policyChecked) { |
| | | const { valid } = await formRef.value.validate(); |
| | | if (valid) { |
| | | let params: API.PhoneMesssageCodeRegisterInput = { |
| | | code: form.verificationCode, |
| | | phoneNumber: form.phoneNumber, |
| | | }; |
| | | let res = await accountServices.phoneMesssageCodeRegister(params); |
| | | if (res) { |
| | | Message.success('注册成功', { |
| | | onClosed: () => { |
| | | goLogin(); |
| | | }, |
| | | }); |
| | | } |
| | | // let params: API.PhoneMesssageCodeRegisterInput = { |
| | | // code: form.verificationCode, |
| | | // phoneNumber: form.phoneNumber, |
| | | // }; |
| | | // let res = await accountServices.phoneMesssageCodeRegister(params); |
| | | // if (res) { |
| | | // Message.success('注册成功', { |
| | | // onClosed: () => { |
| | | // goLogin(); |
| | | // }, |
| | | // }); |
| | | // } |
| | | } |
| | | } else { |
| | | noAccess(); |