import request from '@/webPublic/zyd_public/request/request';
import config from '@/config/config';
window.differenceBetweenServerAndClientTime = 0;
export const getTime = () => {
  return request(`${config.mockServer}/${config.gateWayUrl.zydxg}/InstructorConfigApi/getCurrentDate`, {
    method: 'POST',
    body: {},
  }).then((t) => {
    if (t) {
      window.differenceBetweenServerAndClientTime = t - new Date().getTime(); // 服务器时间 与 客户端时间的差值
    }
    return true;
  });
};

export async function queryCurrent() {
  let t = await getTime();
  return request(`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`, {
    method: 'POST',
    body: {
    },
  });
}
