优化整箱
This commit is contained in:
@@ -83,11 +83,6 @@ export interface CardLoginReq extends AuthReq {
|
|||||||
cardNumber: string
|
cardNumber: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 邮箱登录请求参数 */
|
|
||||||
export interface CardLoginReq extends AuthReq {
|
|
||||||
card: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 登录响应类型 */
|
/** 登录响应类型 */
|
||||||
export interface LoginResp {
|
export interface LoginResp {
|
||||||
token: string
|
token: string
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
||||||
import { type FormInstance, Message } from '@arco-design/web-vue'
|
import { type FormInstance, Message } from '@arco-design/web-vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
import { useTabsStore, useUserStore } from '@/stores'
|
import { useTabsStore, useUserStore } from '@/stores'
|
||||||
|
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = ref<FormInstance>()
|
||||||
@@ -42,14 +43,17 @@ const loading = ref(false)
|
|||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
const handleLogin = async () => {
|
const handleLogin = async () => {
|
||||||
|
console.log("卡号登录handleLogin")
|
||||||
// 检查用户是否已经登录
|
// 检查用户是否已经登录
|
||||||
if (userStore.token) {
|
if (userStore.token) {
|
||||||
|
console.log("卡号-用户已登录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const isInvalid = await formRef.value?.validate()
|
const isInvalid = await formRef.value?.validate()
|
||||||
if (isInvalid) return
|
if (isInvalid) return
|
||||||
try {
|
try {
|
||||||
|
console.log("卡号-校验通过")
|
||||||
loading.value = true
|
loading.value = true
|
||||||
// 调用后端接口校验卡号
|
// 调用后端接口校验卡号
|
||||||
await userStore.cardLogin(form)
|
await userStore.cardLogin(form)
|
||||||
|
|||||||
Reference in New Issue
Block a user