"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getQuestionList = void 0;

var _axios = _interopRequireDefault(require("axios"));

var _bsGlobal = require("../../utils/bs-global");

var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;

var requestDomain = function requestDomain() {
  if (!window.location.hostname.match(/dev/)) return "";
  return "".concat(location.protocol, "//www.tita.gift");
};

var getQuestionList = function getQuestionList(pageNum) {
  var source = (0, _bsGlobal.getSource)();
  var version = (0, _bsGlobal.getVersion)();

  if (source !== 860 || source !== 861 || source !== 862) {
    source = 0;
  }

  return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/const/question?source=").concat(source, "&pageSize=", 3, "&pageNum=").concat(pageNum, "&version=").concat(version == 1 ? 1 : 2)).then(function (res) {
    return res.data;
  });
};

exports.getQuestionList = getQuestionList;