chore: v1 悦码增加天梯校验

This commit is contained in:
wangxuefeng
2025-03-13 14:56:29 +08:00
parent f2c9e426e5
commit 0a3904512d
11 changed files with 68 additions and 6 deletions

View File

@@ -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) => {