import request from "@base/utils/request";

export function loginYx(option) {
  return request({
    url: USER_PREFIX + "/auth/login",
    method: "post",
    ...option,
  });
}

export function getInfo(option) {
  return request({
    url: USER_PREFIX + "/user/currentUser",
    method: "post",
    ...option,
  });
}

export function logout(option) {
  return request({
    url: USER_PREFIX + "/auth/logout",
    method: "post",
    ...option,
  });
}

export function saveAccessMenuLog(option) {
  return request({
    url: USER_PREFIX + "/access_log/saveAccessMenuLog",
    method: "post",
    ...option,
  });
}

export function getLoginTp(duration, option) {
  return request({
    url: USER_PREFIX + "/thirdparty_auth/getTp",
    method: "post",
    isLoading: true,
    data: { duration: duration },
    ...option,
  });
}

export function loginByTp(tp, option) {
  return request({
    url: USER_PREFIX + "/thirdparty_auth/login",
    method: "post",
    isLoading: true,
    useToken: false,
    data: { tp: tp },
    ...option,
  });
}

export function getParameterVauleByCode(option) {
  //初始化外部用户编码
  return request({
    url: USER_PREFIX + "/system_parameter/getByCode",
    method: "post",
    ...option,
  });
}

export function languageSettingListPage(option) {
  //获取语种
  return request({
    url: USER_PREFIX + "/language_setting/listPage",
    method: "post",
    data: {
      enabled: true,
    },
    ...option,
  });
}

export function getBdEnv(option) {
  return request({
    url: USER_PREFIX + `/form_develop/getBdEnv`,
    method: "post",
    ...option,
  });
}

export function getBdFlag(option) {
  return request({
    url: USER_PREFIX + `/form_develop/getBdFlag`,
    method: "post",
    ...option,
  });
}

export function getFileServerInfo(option) {
  return request({
    url: USER_PREFIX + "/logic_param/getFileServerInfo",
    method: "post",
    ...option,
  });
}

export function getLoginConfig(option) {
  return request({
    url: USER_PREFIX + "/login_page/readData",
    method: "post",
    ...option,
  });
}

export function getLogicParamValue(option) {
  return request({
    url: USER_PREFIX + "/logic_param/getParamValue",
    method: "post",
    ...option,
  });
}
