fix : 修复loading加载
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user