t-comm
Version:
专业、稳定、纯粹的工具库
36 lines (29 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var tslib_es6 = require('../tslib.es6-01322ba9.js');
var axios = require('axios');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
function getRtxInfoV2(defaultRtx) {
return new Promise(function (resolve, reject) {
if (window.location.host.startsWith('localhost')) {
resolve({
rtx: defaultRtx || 'developer'
});
return;
}
axios__default["default"]({
url: "".concat(window.location.protocol, "//").concat(window.location.host, "/ts:auth/tauth/info.ashx"),
method: 'get'
}).then(function (response) {
if (response.data.EngName) {
resolve(tslib_es6.__assign(tslib_es6.__assign({}, response.data), {
rtx: response.data.EngName
}));
}
})["catch"](function (err) {
reject(err);
});
});
}
exports.getRtxInfoV2 = getRtxInfoV2;