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

文件预览地址修改

上级 b792eed4
......@@ -63,11 +63,9 @@ export const getOneStopMyInfo = (params = {}) => {
if(!res.groupsId){
res.groupsId = 'pub';
}
return getTime().then((t) => {
res.differenceBetweenServerAndClientTime = t;
localStorage.setItem('user', JSON.stringify(res));
return res;
});
res.differenceBetweenServerAndClientTime = -50;
localStorage.setItem('user', JSON.stringify(res));
return res;
}
});
};
......@@ -10,16 +10,15 @@ export const getTime = () => {
method: 'POST',
body: {},
},
)
.then(t => {
if (t) {
return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值;
} else {
return 0;
}
});
).then(t => {
if (t) {
return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值;
} else {
return 0;
}
});
} else {
return new Promise((resolve) => {
return new Promise(resolve => {
resolve(0);
return 0;
});
......@@ -27,23 +26,19 @@ export const getTime = () => {
};
export async function queryCurrent() {
// let t = await getTime();
const config = window.specialImportantSystemConfig || {};
let token = getToken();
let userInfo = getCurrentUser();
if (token && userInfo.token === token) {
return new Promise((resolve) => {
return new Promise(resolve => {
resolve(userInfo);
return userInfo;
});
}
if (config.mockServer) {
return request(
`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`,
{
method: 'POST',
body: {},
},
);
return request(`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`, {
method: 'POST',
body: {},
});
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论