吉安感知网项目-前端
shuishen
2026-03-05 d75d83bd2a1f4e13634f84f8a4de1f7457187b2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<template>
    <div style="width: 100%; height: 100%; background: #05050f"></div>
</template>
<script setup>
import { useStore } from 'vuex'
import { ElLoading } from 'element-plus'
 
const store = useStore()
const router = useRouter()
const userName = window.localStorage?.userName
const route = useRoute()
let loading = ElLoading.service({ background: 'rgba(0, 0, 0, 0.3)', text: '加载中...' })
const tagWel = computed(() => store.state.tags.tagWel)
const redirect = route.query.redirect
store
    .dispatch('LoginByUsername', {
        username: userName,
        password: userName === 'admin' ? 'admin' :'jadk@2026',
        tenantId: '000000',
        type: 'account',
    })
    .then(() => {
        loading.close()
        router.push(redirect || tagWel.value)
    })
    .catch(err => {
        loading.close()
        // 返回上一个路由
        window.history.go(-1)
    })
</script>
 
<style scoped lang="scss"></style>