优化整箱
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user