t-comm
Version:
专业、稳定、纯粹的工具库
27 lines (24 loc) • 685 B
JavaScript
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(Object.assign(Object.assign({}, response.data), {
rtx: response.data.EngName
}));
}
})["catch"](function (err) {
reject(err);
});
});
}
export { getRtxInfoV2 };