mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
fix: 路由守卫
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { MessagePlugin } from 'tdesign-vue-next';
|
||||
import { router } from '@/router/index.js';
|
||||
import router from '@/router/index.js';
|
||||
|
||||
export const request = async (input: RequestInfo | URL, init?: RequestInit) => {
|
||||
const res = await fetch(input, init);
|
||||
const json = await res.json();
|
||||
if (json.msg.includes('Unauthorized')) {
|
||||
if (json.message.includes('Unauthorized')) {
|
||||
MessagePlugin.error('Token 过期啦, 重新登录吧');
|
||||
localStorage.clear();
|
||||
router.push('/webui');
|
||||
|
||||
Reference in New Issue
Block a user