UNPKG

@mvx/mvc

Version:

@mvx/mvc is mvc framework on server, base on koa, @tsdi frameworks

36 lines (34 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RedirectResult = void 0; var tslib_1 = require("tslib"); var ResultValue_1 = require("./ResultValue"); /** * redirect url * * @export * @class RedirectResult * @extends {ResultValue} */ var RedirectResult = /** @class */ (function (_super) { tslib_1.__extends(RedirectResult, _super); function RedirectResult(url, alt) { var _this = _super.call(this, 'text/html') || this; _this.url = url; _this.alt = alt; return _this; } RedirectResult.prototype.sendValue = function (ctx) { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, ctx.redirect(this.url, this.alt)]; }); }); }; RedirectResultAnn = function () { return { "name": "RedirectResult" }; }; return RedirectResult; }(ResultValue_1.ResultValue)); exports.RedirectResult = RedirectResult; //# sourceMappingURL=../sourcemaps/results/RedirectResult.js.map