|  |  |  | 
|---|
|  |  |  | </nut-form-item> | 
|---|
|  |  |  | </nut-form> | 
|---|
|  |  |  | <LargeButton class="login-btn" @click="handleLogin" :loading="form.loading">登录</LargeButton> | 
|---|
|  |  |  | <div class="go-register-btn" @click="goRegister">立即注册</div> | 
|---|
|  |  |  | <!-- <div class="go-register-btn" @click="goRegister">立即注册</div> --> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script setup lang="ts"> | 
|---|
|  |  |  | 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'; | 
|---|
|  |  |  | 
|---|
|  |  |  | import { useLoginedJump } from '@/hooks'; | 
|---|
|  |  |  | import { useUserStore } from '@/stores/modules/user'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import * as authServices from '@12333/services/apiV2/auth'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'verificationCodeLoginForm', | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function onGetCaptcha() { | 
|---|
|  |  |  | await commonServices.sendVerificationCode( | 
|---|
|  |  |  | await authServices.sendLoginOrRegisterVerifyCode( | 
|---|
|  |  |  | { | 
|---|
|  |  |  | phoneNumber: form.phoneNumber, | 
|---|
|  |  |  | businessType: VerificationCodeBusinessType.PhoneMesssageCodeLogin, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { showLoading: false } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | 
|---|
|  |  |  | form.loading = true; | 
|---|
|  |  |  | await userStore.loginByUsername({ | 
|---|
|  |  |  | phoneNumber: form.phoneNumber, | 
|---|
|  |  |  | code: form.verificationCode, | 
|---|
|  |  |  | verifyCode: form.verificationCode, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | jump(); | 
|---|
|  |  |  | } | 
|---|