fix: 路由守卫
This commit is contained in:
1 parent
c11f1464e8
commit
5461d48644
4 files changed
+24
-10
No files matched your search
@@ -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