提交 688cbd12 作者: 温凯

refactor(api): 在请求拦截器中添加调试日志

上级 9b0d6ea1
......@@ -29,6 +29,8 @@ $axios.interceptors.request.use(
config.headers["Tenant-Id"] = TenantId;
config.headers["terminal"] = 2; // 1 为管理后台 2 为前端项目
config.headers["p-id"] = projectId;
console.log(config, store.state, "token信息验证");
return config;
},
(error) => {
......@@ -73,11 +75,14 @@ $axios.interceptors.response.use(
isRefreshToken = false;
if (data.code === 0) {
const token = data.token;
console.log('store', store);
window.$mmc_stl.app.$store.commit('MMCFlightControlCenter/setState', {
key: 'token',
value: token
})
console.log("store", store);
window.$mmc_stl.app.$store.commit(
"MMCFlightControlCenter/setState",
{
key: "token",
value: token,
}
);
config.headers.Authorization = "Bearer " + token;
requestList.forEach((cb) => {
cb();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论