wupengfei
4 天以前 ae17051ad572fd69f40192e29a96e42c898aff78
apps/cMiniApp/src/subpackages/login/loginByForm/verificationCodeLoginForm.vue
@@ -32,15 +32,14 @@
</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 { ProFormCaptcha } from 'senin-mini/components';
import { VerificationCodeBusinessType } from '@12333/constants';
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',
@@ -73,13 +72,19 @@
});
async function onGetCaptcha() {
  await commonServices.sendVerificationCode(
  const res = await authServices.sendLoginOrRegisterVerifyCode(
    {
      phoneNumber: form.phoneNumber,
      businessType: VerificationCodeBusinessType.PhoneMesssageCodeLogin,
    },
    { showLoading: false }
    { showLoading: false, getResponse: true }
  );
  if (res && process.env.APP_ENV === 'staging') {
    // @ts-ignore
    form.verificationCode = res?.data?.extras?.code ?? '';
  }
  // @ts-ignore
  return res?.data?.data;
}
async function handleLogin() {
@@ -90,7 +95,7 @@
        form.loading = true;
        await userStore.loginByUsername({
          phoneNumber: form.phoneNumber,
          code: form.verificationCode,
          verifyCode: form.verificationCode,
        });
        jump();
      }