diff --git a/src/utils/request.js b/src/utils/request.js index b5a3830..21bb3cd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -29,9 +29,10 @@ //请求拦截器 service.interceptors.request.use((config) => { // 鸿数将token拼接在iframe的src里面 - const token = localStorage.getItem('tokenXF'); - // const token = new URL(window.location).searchParams.get('hsTn'); - // localStorage.setItem('tokenXF', token); + + const token = new URL(window.location).searchParams.get('hsTn'); + + localStorage.setItem('tokenXF', token); if (token) { config.headers['token'] = token; // 让每个请求携带自定义 token 请根据实际情况自行修改