import axios from "axios";
//1. 设置请求的公共地址
axios.defaults.baseURL = "http://sell.h5.itsource.cn:8087";
//2. 添加token令牌
axios.defaults.headers.common["Authorization"] =
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiY3RpbWUiOiIyMDIzLTA1LTIwVDEyOjI1OjE1LjAwMFoiLCJhY2NvdW50IjoiYWRtaW4iLCJwYXNzd29yZCI6IjEyMzQ1NiIsInVzZXJHcm91cCI6Iui2hee6p-euoeeQhuWRmCIsImltZ1VybCI6Imh0dHA6Ly9zZWxsLmg1Lml0c291cmNlLmNuOjgwODcvaW1ncy8xNjkwNTMwNTUwODM4LmpwZWciLCJwaWQiOjAsImlhdCI6MTY5MDUzMjI0NiwiZXhwIjoxNjkxMTM3MDQ2fQ.29SKK1QdOsqRkzEQ3wlNRsI0OWgEaedwLeg2kVTPKXc";
//暴露增加后的axios
export default axios;
请求头固定token写法
最新推荐文章于 2024-04-07 12:07:53 发布