update:默认后台密码:FileCodeBox2023
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
// @ts-ignore
|
||||
import axios from "axios";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: import.meta.env.DEV ? "http://localhost:12345" : "/",
|
||||
timeout: 6000000,
|
||||
headers:{
|
||||
'Authorization':localStorage.getItem('auth')
|
||||
}
|
||||
});
|
||||
// 对响应进行拦截
|
||||
instance.interceptors.request.use(
|
||||
(config: any) => {
|
||||
config.headers= {
|
||||
'Authorization': localStorage.getItem('adminPassword') || '',
|
||||
}
|
||||
return config;
|
||||
});
|
||||
instance.interceptors.response.use(
|
||||
(response:any) => {
|
||||
if (response.data.code === 200) {
|
||||
|
||||
Reference in New Issue
Block a user