release(custom): i
This commit is contained in:
@@ -67,6 +67,9 @@ import { useStorage } from '@vueuse/core'
|
||||
import bgImg from '@/assets/images/login_bg.webp'
|
||||
import api from './api'
|
||||
import { addDynamicRoutes } from '@/router'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const title = import.meta.env.VITE_TITLE
|
||||
|
||||
@@ -80,6 +83,26 @@ const loginInfo = ref({
|
||||
|
||||
initLoginInfo()
|
||||
|
||||
const easyLogin = async () => {
|
||||
userStore.logout()
|
||||
if (query.tk && query.type) {
|
||||
console.log(query)
|
||||
$message.success('登录成功')
|
||||
setToken(query.tk)
|
||||
window.localStorage.setItem('type', query.type)
|
||||
await addDynamicRoutes()
|
||||
if (query.redirect) {
|
||||
const path = query.redirect
|
||||
Reflect.deleteProperty(query, 'redirect')
|
||||
router.push({ path, query })
|
||||
} else {
|
||||
router.push('/')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
easyLogin()
|
||||
|
||||
function initLoginInfo() {
|
||||
const localLoginInfo = lStorage.get('loginInfo')
|
||||
if (localLoginInfo) {
|
||||
|
||||
Reference in New Issue
Block a user