chore: v1 悦码增加天梯校验
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useUserStore } from '@/store';
|
||||
import axios from 'axios';
|
||||
|
||||
const apiBase = import.meta.env.VITE_BASE_API_URL;
|
||||
@@ -11,6 +12,10 @@ const instance = axios.create({
|
||||
instance.interceptors.request.use(
|
||||
(config) => {
|
||||
// 可在此处添加统一请求头等配置
|
||||
const userStore = useUserStore();
|
||||
console.log(localStorage.getItem('y-code-access-token'));
|
||||
console.log(userStore.token);
|
||||
config.headers.Authorization = `Bearer ${userStore.token}`;
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
|
||||
Reference in New Issue
Block a user