token修改
This commit is contained in:
@@ -73,13 +73,19 @@ import { gongkey, login } from '@/api/user'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import type { FormInstance, InputInstance, FormRules } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
|
||||
import { Local } from '@/utils/storage'
|
||||
const router = useRouter()
|
||||
let timer: number
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const usernameRef = ref<InputInstance>()
|
||||
const passwordRef = ref<InputInstance>()
|
||||
const useInfo = useAdminInfo()
|
||||
const userInfo = useAdminInfo()
|
||||
|
||||
Local.remove(ADMIN_INFO)
|
||||
Local.remove(ADMIN_INFO)
|
||||
userInfo.removeToken()
|
||||
interface RuleForm {
|
||||
username: string
|
||||
password: string
|
||||
@@ -107,6 +113,7 @@ const focusInput = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
timer = window.setTimeout(() => {
|
||||
pageBubble.init()
|
||||
}, 0)
|
||||
@@ -134,7 +141,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
}).then(res => {
|
||||
console.log('🚀 ~ file: login.vue:134 ~ gongkey ~ res:', res)
|
||||
|
||||
useInfo.setToken(res.data.token_type + ' ' + res.data.access_token, 'auth')
|
||||
userInfo.setToken(res.data.token_type + ' ' + res.data.access_token, 'auth')
|
||||
state.submitLoading = false
|
||||
router.push({
|
||||
path: 'admin/dashboard'
|
||||
|
||||
Reference in New Issue
Block a user