@foxpage/foxpage-manager
Version:
foxpage resource manager
38 lines (37 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityManagerImpl = void 0;
const common_1 = require("../common");
const data_service_1 = require("../data-service");
/**
* foxpage router
* for internal route and dynamic route of customize
*
* @export
* @class RouterInstance
* @implements {Router}
*/
class SecurityManagerImpl {
constructor(app) {
this.logger = (0, common_1.createLogger)(`App@${app.appId} security Manager`);
}
/**
* ticket check
* foxpage created, eg. for authority the sys route
*
* @param {string} ticket
*/
async ticketCheck(ticket, data) {
var _a, _b;
try {
const { status = false } = (await data_service_1.foxpageDataService.ticketCheck(ticket, data)) || {};
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(ticket + ' checked:' + status);
return status;
}
catch (e) {
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.warn('check token failed: ' + e.message);
return false;
}
}
}
exports.SecurityManagerImpl = SecurityManagerImpl;