diff --git a/src/views/login.vue b/src/views/login.vue index c95bf96..9fa8503 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -9,6 +9,8 @@ import {useAdminStore} from '@/store' import {filterFirstMenu, findFirstThirdLevelMenu, getRoutePath,} from "../utils/menuUtils.js" import {storeToRefs} from "pinia"; +const loading = ref(false) // 登录按钮loading状态 + const router = useRouter() // 获取路由实例 //获取当前浏览器地址 var url = window.location.href //上传服务器时打开注释并注释掉下一行 @@ -38,6 +40,13 @@ const adminStore = useAdminStore() //调用方法 const login = async function () { + if(loading.value) { + console.log('正在登录,请稍后') + return + } + + loading.value = true + try { const result = await request({ url: '/admin/login', @@ -177,7 +186,7 @@ onMounted(() => { -

登录

+

{{loading ? '登录中...' : '登录'}}