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

优化代码

上级 87b64fa5
...@@ -10,6 +10,7 @@ export function getHeaders(url = '') { ...@@ -10,6 +10,7 @@ export function getHeaders(url = '') {
const currentInfo = getCurrentUser() || {}; const currentInfo = getCurrentUser() || {};
const user = getUserInfo() || {}; const user = getUserInfo() || {};
const userId = user.id || currentInfo.xgUserId; const userId = user.id || currentInfo.xgUserId;
// debugger;
const timestamp = user.differenceBetweenServerAndClientTime ? new Date().getTime() + user.differenceBetweenServerAndClientTime : new Date().getTime(); const timestamp = user.differenceBetweenServerAndClientTime ? new Date().getTime() + user.differenceBetweenServerAndClientTime : new Date().getTime();
const secretString = token + userId + timestamp; const secretString = token + userId + timestamp;
if(!token || token === 'null'){ if(!token || token === 'null'){
...@@ -29,6 +30,7 @@ export function getHeaders(url = '') { ...@@ -29,6 +30,7 @@ export function getHeaders(url = '') {
if (isTest) { if (isTest) {
console.log( console.log(
{ {
url: url,
secretString, secretString,
md5S: gg5xxxxx(secretString), md5S: gg5xxxxx(secretString),
timestamp, timestamp,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论