fix : 修复loading加载

This commit is contained in:
2024-03-05 21:54:30 +08:00
parent 768b467e6d
commit bfbc77847a
2 changed files with 11 additions and 6 deletions

View File

@@ -8,14 +8,15 @@ const router = useRouter();
const tokenValue = reactive(router.currentRoute.value.query.token)
console.log('tokenValue', tokenValue)
const init = () => {
// console.log('authStore.casToken(tokenValue)',authStore.casToken(tokenValue))
const loading = ElLoading.service({
lock: true,
text: '登录中...',
background: 'rgba(0, 0, 0, 0.7)',
})
if (authStore.casToken(tokenValue)) {
// ElLoading.service({text: '正在加载系统资源', background: '#409eff', lock: true})
loading.close()
router.push('/')
}
// else {
// router.push('/login')
// }
}
init()
</script>

View File

@@ -66,10 +66,14 @@ const handleLogin = (instance) => {
if(!instance) return
instance.validate( async (valid, fields)=>{
if (!valid) return
ElLoading.service({
lock: true,
text: '登录中...',
background: 'rgba(0, 0, 0, 0.7)',
})
// 发送请求
await authStore.userLogin(loginForm).then(res=>{
if(res) {
ElLoading.service({text: '正在加载系统资源',background: '#409eff',lock: true})
router.push('/')
}else {
getCode()