t-comm
Version:
专业、稳定、纯粹的工具库
28 lines (25 loc) • 733 B
JavaScript
import { _ as __assign } from '../tslib.es6-096fffdd.js';
import axios from 'axios';
function getRtxInfoV2(defaultRtx) {
return new Promise(function (resolve, reject) {
if (window.location.host.startsWith('localhost')) {
resolve({
rtx: defaultRtx || 'developer'
});
return;
}
axios({
url: "".concat(window.location.protocol, "//").concat(window.location.host, "/ts:auth/tauth/info.ashx"),
method: 'get'
}).then(function (response) {
if (response.data.EngName) {
resolve(__assign(__assign({}, response.data), {
rtx: response.data.EngName
}));
}
})["catch"](function (err) {
reject(err);
});
});
}
export { getRtxInfoV2 };