update log format

This commit is contained in:
engigu
2024-01-13 11:43:54 +08:00
parent 05fda3f764
commit 511cdb6106
8 changed files with 158 additions and 56 deletions
+5 -2
View File
@@ -3,14 +3,14 @@ import axios from 'axios';
import { ElMessage } from 'element-plus'
import { usePageState } from '../store/page_sate';
import { CONSTANT } from '../constant';
import config from '../../config.js';
import config from '../../config.js';
const ERR_NETWORK = "ERR_NETWORK";
const request = axios.create({
baseURL: config.apiUrl,
timeout: 50000,
withCredentials: true,
withCredentials: true,
});
@@ -81,6 +81,9 @@ const logout = () => {
const pageState = usePageState();
pageState.setIsLogin(true);
localStorage.setItem(CONSTANT.STORE_TOKEN_NAME, "");
setTimeout(() => {
window.location.href = '/';
}, 500);
};
export { request, handleException, logout };