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

修改鉴权代码

上级 2714f27a
import { getCurrentUser, getToken } from '@/webPublic/one_stop_public/utils/token';
import Md5 from 'js-md5';
import { getIsBei_Dian } from '@/webPublic/zyd_public/utils/utils';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
const isTest = getUrlInfo().test;
export function getHeaders(url = '') {
const token = getToken();
const currentInfo = getCurrentUser();
const timestamp = window.serviceCurrentDate || new Date().getTime();
const secretString = token + currentInfo.xgUserId + timestamp;
// const secretString = token + '112233' + timestamp;
const res = {
headers: {
Authorization: `bearer ${token}`,
},
};
if(getIsBei_Dian() && currentInfo?.userid){
res.headers.auth = Md5(secretString);
res.headers.timestamp = timestamp;
if (isTest) {
console.log(
{
secretString,
md5S: Md5(secretString),
timestamp,
xgUserId: currentInfo.xgUserId,
typeString: currentInfo.typeString,
},
);
}
}
return res;
}
......@@ -337,36 +337,8 @@ export function checkInputType(data, type) {
return true;
}
const isTest = getUrlInfo().test;
export function getHeaders(url = '') {
const token = getToken();
const currentInfo = getCurrentUser();
const timestamp = window.serviceCurrentDate || new Date().getTime();
const secretString = token + currentInfo.xgUserId + timestamp;
const res = {
headers: {
Authorization: `bearer ${token}`,
},
};
if(getIsBei_Dian() && currentInfo?.userid){
res.headers.auth = Md5(secretString);
res.headers.timestamp = timestamp;
if (isTest) {
console.log(
{
secretString,
md5S: Md5(secretString),
timestamp,
xgUserId: currentInfo.xgUserId,
typeString: currentInfo.typeString,
},
);
}
}
return res;
}
export { getHeaders } from './getHeaders';
export function getIsA_Ba() { // 判断当前环境是不是阿坝学校 然后做定制需求. 主要用于定制开发
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论