提交 b348d330 authored 作者: 钟是志's avatar 钟是志

团委H5修改

上级 d86ca888
// import { getCurrentUser, getToken } from '@/webPublic/one_stop_public/utils/token';
import Md5 from 'js-md5';
import {getCurrentUser, getUserInfo} from '@/H5Public/utils/2022new/currentUser';
// import {getCurrentUser, getUserInfo} from '@/H5Public/utils/2022new/currentUser';
import { getIsBei_Dian, getToken } from '@/H5Public/utils/authority';
import { getUrlParams } from '@/H5Public/utils/handleString';
const isTest = getUrlParams().test;
// import { getUrlParams } from '@/H5Public/utils/handleString';
export function getHeaders(url = '') {
const token = getToken();
const currentInfo = getCurrentUser();
const onestopInfo = getUserInfo();
const id = onestopInfo.id || currentInfo.xgUserId;
const timestamp = onestopInfo.differenceBetweenServerAndClientTime ? new Date().getTime() + onestopInfo.differenceBetweenServerAndClientTime : new Date().getTime();
const secretString = token + id + timestamp;
// const currentInfo = getCurrentUser();
// const onestopInfo = getUserInfo();
// const id = onestopInfo.id || currentInfo.xgUserId;
// const timestamp = onestopInfo.differenceBetweenServerAndClientTime ? new Date().getTime() + onestopInfo.differenceBetweenServerAndClientTime : new Date().getTime();
// const secretString = token + id + timestamp;
const res = {
headers: {
Authorization: `bearer ${token}`,
},
};
if(getIsBei_Dian() && id){
res.headers.auth = Md5(secretString);
res.headers.timestamp = timestamp;
}
//
// if(getIsBei_Dian() && process.env.){
// }
return res;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论