refactor: 优化认证及客户端相关代码

This commit is contained in:
2024-12-27 20:29:59 +08:00
parent f0dff8b753
commit 6ff307251f
17 changed files with 155 additions and 190 deletions

View File

@@ -40,7 +40,7 @@
<script setup lang="ts">
import { type FormInstance, Message } from '@arco-design/web-vue'
import { AuthTypeEnum, type BehaviorCaptchaReq } from '@/apis'
import type { BehaviorCaptchaReq } from '@/apis'
// import { type BehaviorCaptchaReq, getSmsCaptcha } from '@/apis'
import { useTabsStore, useUserStore } from '@/stores'
import * as Regexp from '@/utils/regexp'
@@ -69,7 +69,7 @@ const handleLogin = async () => {
if (isInvalid) return
try {
loading.value = true
await userStore.phoneLogin({ ...form, clientId: import.meta.env.VITE_CLIENT_ID, authType: AuthTypeEnum.PHONE })
await userStore.phoneLogin(form)
tabsStore.reset()
const { redirect, ...othersQuery } = router.currentRoute.value.query
await router.push({