优化整箱

This commit is contained in:
zc
2026-04-27 17:14:24 +08:00
parent 79f9124c9a
commit a01a36e1b7
2 changed files with 4 additions and 5 deletions

View File

@@ -83,11 +83,6 @@ export interface CardLoginReq extends AuthReq {
cardNumber: string
}
/** 邮箱登录请求参数 */
export interface CardLoginReq extends AuthReq {
card: string
}
/** 登录响应类型 */
export interface LoginResp {
token: string

View File

@@ -22,6 +22,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { type FormInstance, Message } from '@arco-design/web-vue'
import { useRouter } from 'vue-router'
import { useTabsStore, useUserStore } from '@/stores'
const formRef = ref<FormInstance>()
@@ -42,14 +43,17 @@ const loading = ref(false)
// 登录
const handleLogin = async () => {
console.log("卡号登录handleLogin")
// 检查用户是否已经登录
if (userStore.token) {
console.log("卡号-用户已登录")
return
}
const isInvalid = await formRef.value?.validate()
if (isInvalid) return
try {
console.log("卡号-校验通过")
loading.value = true
// 调用后端接口校验卡号
await userStore.cardLogin(form)