wupengfei
2 天以前 7eb002b8aa27e616b8b98074bee97861ea922451
apps/cMiniApp/src/subpackages/login/loginByForm/verificationCodeLoginForm.vue
@@ -32,15 +32,15 @@
</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';
import { APP_ENV } from '@/constants';
defineOptions({
  name: 'verificationCodeLoginForm',
@@ -73,13 +73,16 @@
});
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 && APP_ENV === 'staging') {
    // @ts-ignore
    form.verificationCode = res?.data?.extras?.code ?? '';
  }
}
async function handleLogin() {
@@ -90,7 +93,7 @@
        form.loading = true;
        await userStore.loginByUsername({
          phoneNumber: form.phoneNumber,
          code: form.verificationCode,
          verifyCode: form.verificationCode,
        });
        jump();
      }