tplus-api
Version:
tplus api invoke
40 lines (34 loc) • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _mutantsMicrofx = require('mutants-microfx');
var _app = require('../const/app');
var ClientInfo = /** @class */function () {
function ClientInfo(osRelease, networkStatus, manufacturer, model) {
this.osRelease = osRelease;
this.networkStatus = networkStatus;
this.manufacturer = manufacturer;
this.model = model;
}
ClientInfo.getClientInfo = function (deviceInfo) {
var clientInfo = new ClientInfo(deviceInfo.osRelease, deviceInfo.networkStatus, deviceInfo.manufacturer, deviceInfo.model);
return clientInfo;
};
//缓存数据
ClientInfo.prototype.cache = function () {
_mutantsMicrofx.localStore.set(_app.clientInfoKey, this);
};
//从缓存中恢复ClientInfo对象
ClientInfo.restore = function () {
var clientInfo = _mutantsMicrofx.localStore.get(_app.clientInfoKey);
if (clientInfo) {
return clientInfo;
}
return undefined;
};
return ClientInfo;
}();
exports.default = ClientInfo;
//# sourceMappingURL=ClientInfo.js.map
//# sourceMappingURL=ClientInfo.js.map