ge-admin-auth.umd.min.js 26 KB

12345678910111213141516
  1. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@nebular/auth"),require("@ngx-translate/core"),require("@nebular/theme"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@angular/common/http"),require("jsencrypt")):"function"==typeof define&&define.amd?define("ge-admin-auth",["exports","@angular/core","@angular/common","@angular/router","@nebular/auth","@ngx-translate/core","@nebular/theme","@angular/forms","rxjs","rxjs/operators","@angular/common/http","jsencrypt"],t):t((e=e||self)["ge-admin-auth"]={},e.ng.core,e.ng.common,e.ng.router,e.auth,e.core$1,e.theme,e.ng.forms,e.rxjs,e.rxjs.operators,e.ng.common.http,e.jsencrypt)}(this,(function(e,t,r,n,s,o,a,i,l,u,c,g){"use strict";
  2. /*! *****************************************************************************
  3. Copyright (c) Microsoft Corporation. All rights reserved.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  5. this file except in compliance with the License. You may obtain a copy of the
  6. License at http://www.apache.org/licenses/LICENSE-2.0
  7. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  9. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  10. MERCHANTABLITY OR NON-INFRINGEMENT.
  11. See the Apache Version 2.0 License for specific language governing permissions
  12. and limitations under the License.
  13. ***************************************************************************** */var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function p(e,t){function r(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var h={"与第一次输入不符合":"与第一次输入不符合.","修改密码":"修改密码","密码":"密码","密码:":"密码:","密码是必填的":"密码是必填的","密码规则提示":"密码应该包含 最小长度 {{minLength}} 最大长度 {{maxLength}} 个字符","您好,欢迎使用":"您好,欢迎使用","成功!":"成功!","新密码":"新密码","新密码:":"新密码:","新密码是必填的!":"新密码是必填的!","旧密码:":"旧密码:","旧密码是必填的!":"旧密码是必填的","登出提示":"正在登出, 请等待...","登录":"登录","确认密码":"确认密码","确认密码:":"确认密码:","确认密码是必填的!":"确认密码是必填的!","请设置您的新密码":"请设置您的新密码","账户":"账户","账户:":"账户:","账户是必填的":"账户是必填的","错误!":"错误!"},f={"与第一次输入不符合":"與第一次輸入不符合.","修改密码":"更改密碼","密码":"密碼","密码:":"密碼:","密码是必填的":"必須填寫密碼","密码规则提示":"密碼應該包含 最小長度 {{minLength}} 最大長度 {{maxLength}} 個字符","您好,欢迎使用":"您好,歡迎使用","成功!":"成功!","新密码":"新密碼","新密码:":"新密碼:","新密码是必填的!":"必須填寫新密碼","旧密码:":"舊密碼:","旧密码是必填的!":"必須填寫舊密碼","登出提示":"正在登出, 請稍候⋯","登录":"登入","确认密码":"確認密碼","确认密码:":"確認密碼:","确认密码是必填的!":"必須填寫確認密碼","请设置您的新密码":"請設置您的新密碼","账户":"賬戶","账户:":"賬戶:","账户是必填的":"必須填寫賬戶","错误!":"錯誤!"},m=new t.InjectionToken("AUTH_DEFAULT_LANG"),w=function(){function e(e,t){this._translate=e,this._translate.setTranslation("zh-cn",h),this._translate.setTranslation("zh-hk",f),this._translate.setDefaultLang(t||"zh-cn"),this._translate.use(t||"zh-cn")}return e.prototype.setTranslate=function(e){this._translate.use(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:o.TranslateService},{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[m]}]}]},e}();function y(e,t,r){var n,s;void 0===e&&(e={});var o=t.split("."),a=e;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),l=i.next();!l.done;l=i.next()){var u=l.value;if(!a)break;a=a[u]}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=i.return)&&s.call(i)}finally{if(n)throw n.error}}return void 0===a?r:a}var b=function(){function e(e,t,r,n,s){void 0===r&&(r={}),this.service=e,this.langService=t,this.options=r,this.cd=n,this.router=s,this.redirectDelay=0,this.showMessages={},this.strategy="",this.errors=[],this.messages=[],this.user={},this.submitted=!1,this.socialLinks=[],this.rememberMe=!1,this.redirectDelay=this.getConfigValue("forms.login.redirectDelay"),this.showMessages=this.getConfigValue("forms.login.showMessages"),this.strategy=this.getConfigValue("forms.login.strategy"),this.socialLinks=this.getConfigValue("forms.login.socialLinks"),this.rememberMe=this.getConfigValue("forms.login.rememberMe")}return e.prototype.login=function(){var e=this;this.errors=[],this.messages=[],this.submitted=!0,this.service.authenticate(this.strategy,this.user).subscribe((function(t){e.submitted=!1,t.isSuccess()?e.messages=t.getMessages():e.errors=t.getErrors();var r=t.getRedirect();r&&setTimeout((function(){return e.router.navigateByUrl(r)}),e.redirectDelay),e.cd.detectChanges()}))},e.prototype.getConfigValue=function(e){return y(this.options,e,null)},e.decorators=[{type:t.Component,args:[{selector:"auth-login",template:'<h1 id="title" class="title" translate>登录</h1>\r\n<p class="sub-title" translate>您好,欢迎使用</p>\r\n\r\n<nb-alert *ngIf="showMessages.error && errors?.length && !submitted" outline="danger" role="alert">\r\n <p class="alert-title"><b translate>错误!</b></p>\r\n <ul class="alert-message-list">\r\n <li *ngFor="let error of errors" class="alert-message">{{ error }}</li>\r\n </ul>\r\n</nb-alert>\r\n\r\n<nb-alert\r\n *ngIf="showMessages.success && messages?.length && !submitted"\r\n outline="success"\r\n role="alert"\r\n>\r\n <p class="alert-title"><b translate>成功!</b></p>\r\n <ul class="alert-message-list">\r\n <li *ngFor="let message of messages" class="alert-message">{{ message }}</li>\r\n </ul>\r\n</nb-alert>\r\n\r\n<form (ngSubmit)="login()" #form="ngForm" aria-labelledby="title">\r\n <div class="form-control-group">\r\n <label class="label" for="input-email" translate>账户:</label>\r\n <input\r\n nbInput\r\n fullWidth\r\n [(ngModel)]="user.loginId"\r\n #loginId="ngModel"\r\n name="loginId"\r\n id="input-loginId"\r\n placeholder="{{ \'账户\' | translate }}"\r\n autofocus\r\n [status]="loginId.dirty ? (loginId.invalid ? \'danger\' : \'success\') : \'\'"\r\n [required]="true"\r\n [attr.aria-invalid]="loginId.invalid && loginId.touched ? true : null"\r\n />\r\n <ng-container *ngIf="loginId.invalid && loginId.touched">\r\n <p class="error-message" *ngIf="loginId.errors?.required" translate="账户是必填的">\r\n\r\n </p>\r\n </ng-container>\r\n </div>\r\n\r\n <div class="form-control-group">\r\n <label class="label" for="input-password" translate>密码:</label>\r\n <input\r\n nbInput\r\n fullWidth\r\n [(ngModel)]="user.loginPassword"\r\n #password="ngModel"\r\n name="password"\r\n type="password"\r\n id="input-password"\r\n placeholder="{{\'密码\'|translate}}"\r\n [status]="password.dirty ? (password.invalid ? \'danger\' : \'success\') : \'\'"\r\n [required]="true"\r\n [minlength]="getConfigValue(\'forms.validation.password.minLength\')"\r\n [maxlength]="getConfigValue(\'forms.validation.password.maxLength\')"\r\n [attr.aria-invalid]="password.invalid && password.touched ? true : null"\r\n />\r\n <ng-container *ngIf="password.invalid && password.touched">\r\n <p class="error-message" *ngIf="password.errors?.required" translate="密码是必填的">\r\n\r\n </p>\r\n <p class="error-message" *ngIf="password.errors?.minlength || password.errors?.maxlength"\r\n translate="密码规则提示" [translateParams]="{minLength: getConfigValue(\'forms.validation.password.minLength\'), maxLength:getConfigValue(\'forms.validation.password.maxLength\')}"\r\n >\r\n 密码应该包含 最小长度 {{ getConfigValue(\'forms.validation.password.minLength\') }} 最大长度\r\n {{ getConfigValue(\'forms.validation.password.maxLength\') }}\r\n 个字符\r\n </p>\r\n </ng-container>\r\n </div>\r\n\r\n \x3c!--<div class="form-control-group accept-group">--\x3e\r\n \x3c!--<nb-checkbox name="rememberMe" [(ngModel)]="user.rememberMe" *ngIf="rememberMe">记住账号</nb-checkbox>--\x3e\r\n \x3c!--&lt;!&ndash;<a class="forgot-password" routerLink="../request-password">Forgot Password?</a>&ndash;&gt;--\x3e\r\n \x3c!--</div>--\x3e\r\n\r\n <button\r\n nbButton\r\n fullWidth\r\n status="success"\r\n [disabled]="submitted || !form.valid"\r\n [class.btn-pulse]="submitted"\r\n translate="登录"\r\n >\r\n </button>\r\n</form>\r\n\r\n\x3c!--<section *ngIf="socialLinks && socialLinks.length > 0" class="links" aria-label="Social sign in">--\x3e\r\n\x3c!--or enter with:--\x3e\r\n\x3c!--<div class="socials">--\x3e\r\n\x3c!--<ng-container *ngFor="let socialLink of socialLinks">--\x3e\r\n\x3c!--<a *ngIf="socialLink.link"--\x3e\r\n\x3c!--[routerLink]="socialLink.link"--\x3e\r\n\x3c!--[attr.target]="socialLink.target"--\x3e\r\n\x3c!--[attr.class]="socialLink.icon"--\x3e\r\n\x3c!--[class.with-icon]="socialLink.icon">{{ socialLink.title }}</a>--\x3e\r\n\x3c!--<a *ngIf="socialLink.url"--\x3e\r\n\x3c!--[attr.href]="socialLink.url"--\x3e\r\n\x3c!--[attr.target]="socialLink.target"--\x3e\r\n\x3c!--[attr.class]="socialLink.icon"--\x3e\r\n\x3c!--[class.with-icon]="socialLink.icon">{{ socialLink.title }}</a>--\x3e\r\n\x3c!--</ng-container>--\x3e\r\n\x3c!--</div>--\x3e\r\n\x3c!--</section>--\x3e\r\n\r\n\x3c!--<section class="another-action" aria-label="Register">--\x3e\r\n\x3c!--Don\'t have an account? <a class="text-link" routerLink="../register">Register</a>--\x3e\r\n\x3c!--</section>--\x3e\r\n',changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:s.NbAuthService},{type:w},{type:void 0,decorators:[{type:t.Inject,args:[s.NB_AUTH_OPTIONS]}]},{type:t.ChangeDetectorRef},{type:n.Router}]},e}(),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.baseEndpoint="/api/auth/",t.getPublicKey={endpoint:"getPublicKey",method:"get"},t.login={alwaysFail:!1,endpoint:"login",method:"post",redirect:{success:"/",failure:null},defaultErrors:["未知错误!"],defaultMessages:["You have been successfully logged in."]},t.createUser={endpoint:"createUser",method:"post",defaultErrors:["未知错误!"]},t.updatePasswordForAdmin={endpoint:"updatePasswordForAdmin",method:"patch",defaultErrors:["未知错误!"]},t.register={alwaysFail:!1,endpoint:"register",method:"post",redirect:{success:"/",failure:null},defaultErrors:["Something went wrong, please try again."],defaultMessages:["You have been successfully registered."]},t.requestPass={endpoint:"request-pass",method:"post",redirect:{success:"/",failure:null},defaultErrors:["Something went wrong, please try again."],defaultMessages:["Reset password instructions have been sent to your email."]},t.resetPass={endpoint:"updateUserPassword",method:"patch",redirect:{success:"/",failure:null},defaultErrors:["未知错误."],defaultMessages:["Your password has been successfully changed."]},t.logout={alwaysFail:!1,endpoint:"logout",method:"delete",redirect:{success:"/",failure:null},defaultErrors:["Something went wrong, please try again."],defaultMessages:["You have been successfully logged out."]},t.errors={key:"messager",getter:function(e,t,r){return[y(t.error,r.errors.key,r[e].defaultErrors)]}},t.messages={key:"messager",getter:function(e,t,r){return[y(t.body,r.messages.key,!1)]}},t.success={key:"success",getter:function(e,t,r){return y(t.body,r.success.key,r[e].defaultMessages)}},t}return p(t,e),t}(s.NbAuthStrategyOptions),x=new v,P=function(e){this.message=e},L=function(e){function r(t,r){var n=e.call(this)||this;return n.http=t,n.route=r,n.defaultOptions=x,n}return p(r,e),r.setup=function(e){return[r,e]},r.prototype.authenticate=function(e){var t=this,r=this.getOption("login.method"),n=this.getActionEndpoint("login");this.getOption("login.requireValidToken");return this.getEncryptPassword(e.loginPassword).pipe(u.map((function(o){return o.loginID=e.loginId,t.http.request(r,n,{body:o,observe:"response"}).pipe(u.map((function(r){if(t.getOption("login.alwaysFail"))throw t.createFailResponse(e);if(!t.getOption("success.getter")("login",r,t.options))throw new P(t.getOption("messages.getter")("login",r,t.options));return r})),u.map((function(e){return new s.NbAuthResult(!0,e,t.getOption("login.redirect.success"),[],t.getOption("messages.getter")("login",e,t.options))})),u.catchError((function(e){return t.handleResponseError(e,"login")})))})),u.concatAll())},r.prototype.logout=function(){var e=this,t=this.getOption("logout.method"),r=this.getActionEndpoint("logout");return l.of({}).pipe(u.switchMap((function(n){return r?e.http.request(t,r,{observe:"response"}):l.of(n)})),u.map((function(t){if(e.getOption("logout.alwaysFail"))throw e.createFailResponse();return t})),u.map((function(t){return new s.NbAuthResult(!0,t,e.getOption("logout.redirect.success"),[],e.getOption("messages.getter")("logout",t,e.options))})),u.catchError((function(t){return e.handleResponseError(t,"logout")})))},r.prototype.refreshToken=function(e){},r.prototype.register=function(e){},r.prototype.requestPassword=function(e){},r.prototype.resetPassword=function(e){var t=this,r="resetPass",n=this.getOption(r+".method"),o=this.getActionEndpoint(r);return this.getEncryptPassword(e.loginPasswordNew+"-"+e.loginPasswordOld).pipe(u.map((function(a){return a.passwordData=a.loginPassword,t.http.request(n,o,{body:a,observe:"response"}).pipe(u.map((function(n){if(t.getOption(r+".alwaysFail"))throw t.createFailResponse(e);if(!t.getOption("success.getter")(r,n,t.options))throw new P(t.getOption("messages.getter")(r,n,t.options));return n})),u.map((function(e){return new s.NbAuthResult(!0,e,t.getOption(r+".redirect.success"),[],t.getOption("messages.getter")(r,e,t.options))})),u.catchError((function(e){return t.handleResponseError(e,r)})))})),u.concatAll())},r.prototype.createUser=function(e){var t=this,r="createUser",n=this.getOption(r+".method"),o=this.getActionEndpoint(r);return this.getEncryptPassword(e.loginPassword).pipe(u.map((function(a){return a.userName=e.userName,a.loginID=e.loginID,t.http.request(n,o,{body:a,observe:"response"}).pipe(u.map((function(n){if(t.getOption(r+".alwaysFail"))throw t.createFailResponse(e);if(!t.getOption("success.getter")(r,n,t.options))throw new P(t.getOption("messages.getter")(r,n,t.options));return n})),u.map((function(e){return new s.NbAuthResult(!0,e,t.getOption(r+".redirect.success"),[],t.getOption("messages.getter")(r,e,t.options))})),u.catchError((function(e){return t.handleResponseError(e,r)})))})),u.concatAll())},r.prototype.updatePasswordForAdmin=function(e){var t=this,r="updatePasswordForAdmin",n=this.getOption(r+".method"),o=this.getActionEndpoint(r);return this.getEncryptPassword(e.loginPassword).pipe(u.map((function(a){return a.userID=e.userID,t.http.request(n,o,{body:a,observe:"response"}).pipe(u.map((function(n){if(t.getOption(r+".alwaysFail"))throw t.createFailResponse(e);if(!t.getOption("success.getter")(r,n,t.options))throw new P(t.getOption("messages.getter")(r,n,t.options));return n})),u.map((function(e){return new s.NbAuthResult(!0,e,t.getOption(r+".redirect.success"),[],t.getOption("messages.getter")(r,e,t.options))})),u.catchError((function(e){return t.handleResponseError(e,r)})))})),u.concatAll())},r.prototype.getEncryptPassword=function(e){var t=this,r="getPublicKey",n=this.getOption(r+".method"),s=this.getActionEndpoint(r);return this.http.request(n,s,{observe:"response"}).pipe(u.map((function(t){return function(e,t){var r=Date.now(),n=new g.JSEncrypt;n.setPublicKey(e.data.publicPEMKey);var s=n.encrypt(t+r);return{cryptoKeyID:e.data.cryptoKeyID,utcTimestamp:r,loginPassword:s}}(t.body,e)})),u.catchError((function(e){return t.handleResponseError(e,r)})))},r.prototype.handleResponseError=function(e,t){var r=[];return e instanceof c.HttpErrorResponse?r=this.getOption("errors.getter")(t,e,this.options):e instanceof s.NbAuthIllegalTokenError?r.push(e.message):e instanceof P?r=e.message:r.push("Something went wrong."),l.of(new s.NbAuthResult(!1,e,this.getOption(t+".redirect.failure"),r))},r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[{type:c.HttpClient},{type:n.ActivatedRoute}]},r}(s.NbAuthStrategy),I=function(){function e(e,t,r,n,s){void 0===r&&(r={}),this.service=e,this.langService=t,this.options=r,this.cd=n,this.router=s,this.redirectDelay=0,this.showMessages={},this.strategy="",this.submitted=!1,this.errors=[],this.messages=[],this.user={},this.redirectDelay=this.getConfigValue("forms.resetPassword.redirectDelay"),this.showMessages=this.getConfigValue("forms.resetPassword.showMessages"),this.strategy=this.getConfigValue("forms.resetPassword.strategy")}return e.prototype.resetPass=function(){var e=this;this.errors=this.messages=[],this.submitted=!0,this.service.resetPassword(this.strategy,this.user).subscribe((function(t){e.submitted=!1,t.isSuccess()?e.messages=t.getMessages():e.errors=t.getErrors();var r=t.getRedirect();r&&setTimeout((function(){return e.router.navigateByUrl(r)}),e.redirectDelay),e.cd.detectChanges()}))},e.prototype.getConfigValue=function(e){return y(this.options,e,null)},e.decorators=[{type:t.Component,args:[{selector:"auth-reset-password-page",template:'<h1 id="title" class="title" translate>修改密码</h1>\r\n<p class="sub-title" translate>请设置您的新密码</p>\r\n\r\n<nb-alert *ngIf="showMessages.error && errors?.length && !submitted" outline="danger" role="alert">\r\n <p class="alert-title"><b translate>错误!</b></p>\r\n <ul class="alert-message-list">\r\n <li *ngFor="let error of errors" class="alert-message">{{ error }}</li>\r\n </ul>\r\n</nb-alert>\r\n\r\n<nb-alert *ngIf="showMessages.success && messages?.length && !submitted" outline="success" role="alert">\r\n <p class="alert-title"><b translate>成功!</b></p>\r\n <ul class="alert-message-list">\r\n <li *ngFor="let message of messages" class="alert-message">{{ message }}</li>\r\n </ul>\r\n</nb-alert>\r\n\r\n<form (ngSubmit)="resetPass()" #resetPassForm="ngForm" aria-labelledby="title">\r\n\r\n <div class="form-control-group">\r\n <label class="label" for="input-old-password" translate>旧密码:</label>\r\n <input nbInput\r\n [(ngModel)]="user.loginPasswordOld"\r\n #oldPassword="ngModel"\r\n type="password"\r\n id="input-old-password"\r\n name="oldPassword"\r\n class="first"\r\n placeholder="{{\'新密码\'| translate}}"\r\n autofocus\r\n fullWidth\r\n [status]="oldPassword.dirty ? (oldPassword.invalid ? \'danger\' : \'success\') : \'\'"\r\n [required]="getConfigValue(\'forms.validation.password.required\')"\r\n [minlength]="getConfigValue(\'forms.validation.password.minLength\')"\r\n [maxlength]="getConfigValue(\'forms.validation.password.maxLength\')"\r\n [attr.aria-invalid]="oldPassword.invalid && oldPassword.touched ? true : null">\r\n <ng-container *ngIf="oldPassword.invalid && oldPassword.touched">\r\n <p class="error-message" *ngIf="oldPassword.errors?.required" translate="旧密码是必填的!">\r\n\r\n </p>\r\n <p class="error-message" *ngIf="oldPassword.errors?.minlength || oldPassword.errors?.maxlength"\r\n translate="密码规则提示" [translateParams]="{minLength: getConfigValue(\'forms.validation.password.minLength\'), maxLength:getConfigValue(\'forms.validation.password.maxLength\')}">\r\n 密码应该包含\r\n 最小长度 {{ getConfigValue(\'forms.validation.password.minLength\') }}\r\n 最大长度 {{ getConfigValue(\'forms.validation.password.maxLength\') }}\r\n 个字符\r\n </p>\r\n </ng-container>\r\n </div>\r\n\r\n <div class="form-control-group">\r\n <label class="label" for="input-new-password" translate>新密码:</label>\r\n <input nbInput\r\n [(ngModel)]="user.loginPasswordNew"\r\n #newPassword="ngModel"\r\n type="password"\r\n id="input-new-password"\r\n name="newPassword"\r\n class="first"\r\n placeholder="{{\'新密码\'| translate}}"\r\n autofocus\r\n fullWidth\r\n [status]="newPassword.dirty ? (newPassword.invalid ? \'danger\' : \'success\') : \'\'"\r\n [required]="getConfigValue(\'forms.validation.password.required\')"\r\n [minlength]="getConfigValue(\'forms.validation.password.minLength\')"\r\n [maxlength]="getConfigValue(\'forms.validation.password.maxLength\')"\r\n [attr.aria-invalid]="newPassword.invalid && newPassword.touched ? true : null">\r\n <ng-container *ngIf="newPassword.invalid && newPassword.touched">\r\n <p class="error-message" *ngIf="newPassword.errors?.required" translate="新密码是必填的!">\r\n\r\n </p>\r\n <p class="error-message" *ngIf="newPassword.errors?.minlength || newPassword.errors?.maxlength"\r\n translate="密码规则提示"\r\n [translateParams]="{minLength: getConfigValue(\'forms.validation.password.minLength\'), maxLength:getConfigValue(\'forms.validation.password.maxLength\')}">\r\n\r\n 密码应该包含\r\n 最小长度 {{ getConfigValue(\'forms.validation.password.minLength\') }}\r\n 最大长度 {{ getConfigValue(\'forms.validation.password.maxLength\') }}\r\n 个字符\r\n </p>\r\n </ng-container>\r\n </div>\r\n\r\n <div class="form-group">\r\n <label class="label" for="input-re-password" translate>确认密码:</label>\r\n <input nbInput\r\n [(ngModel)]="user.confirmPassword"\r\n #rePass="ngModel"\r\n id="input-re-password"\r\n name="rePass"\r\n type="password"\r\n class="last"\r\n placeholder="{{\'确认密码\'| translate}}"\r\n fullWidth\r\n [status]="rePass.touched\r\n ? (rePass.invalid || newPassword.value != rePass.value ? \'danger\' : \'success\')\r\n : \'\'"\r\n [required]="getConfigValue(\'forms.validation.password.required\')"\r\n [attr.aria-invalid]="rePass.invalid && rePass.touched ? true : null">\r\n <ng-container *ngIf="rePass.touched">\r\n <p class="error-message" *ngIf="rePass.invalid && rePass.errors?.required" translate="确认密码是必填的!">\r\n\r\n </p>\r\n <p class="error-message" *ngIf="newPassword.value != rePass.value && !rePass.errors?.required" translate="与第一次输入不符合"></p>\r\n </ng-container>\r\n </div>\r\n\r\n <button nbButton\r\n status="success"\r\n fullWidth\r\n [disabled]="submitted || !resetPassForm.valid"\r\n [class.btn-pulse]="submitted" translate="修改密码">\r\n </button>\r\n</form>\r\n\r\n\x3c!--<section class="sign-in-or-up" aria-label="Sign in or sign up">--\x3e\r\n \x3c!--<p><a class="text-link" routerLink="../login">Back to Log In</a></p>--\x3e\r\n \x3c!--<p><a class="text-link" routerLink="../register">Register</a></p>--\x3e\r\n\x3c!--</section>--\x3e\r\n',changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[":host .form-group:last-of-type{margin-bottom:3rem}"]}]}],e.ctorParameters=function(){return[{type:s.NbAuthService},{type:w},{type:void 0,decorators:[{type:t.Inject,args:[s.NB_AUTH_OPTIONS]}]},{type:t.ChangeDetectorRef},{type:n.Router}]},e}(),O=function(){function e(e,t,r,n){void 0===r&&(r={}),this.service=e,this.langService=t,this.options=r,this.router=n,this.redirectDelay=0,this.strategy="",this.redirectDelay=this.getConfigValue("forms.logout.redirectDelay"),this.strategy=this.getConfigValue("forms.logout.strategy")}return e.prototype.ngOnInit=function(){this.logout(this.strategy)},e.prototype.logout=function(e){var t=this;this.service.logout(e).subscribe((function(e){var r=e.getRedirect();r&&setTimeout((function(){return t.router.navigateByUrl(r)}),t.redirectDelay)}))},e.prototype.getConfigValue=function(e){return s.getDeepFromObject(this.options,e,null)},e.decorators=[{type:t.Component,args:[{selector:"auth-logout",template:'<div translate="登出提示"></div>\r\n',styles:["div{text-align:center}"]}]}],e.ctorParameters=function(){return[{type:s.NbAuthService},{type:w},{type:void 0,decorators:[{type:t.Inject,args:[s.NB_AUTH_OPTIONS]}]},{type:n.Router}]},e}(),C=function(){function e(){this.subject=new l.Subject}return e.prototype.changeStatus=function(e){this.status!==e&&(this.status=e,this.subject.next(e))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}(),M={Login:1,Logout:2};M[M.Login]="Login",M[M.Logout]="Logout";var k=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[b,I,O],imports:[r.CommonModule,a.NbLayoutModule,a.NbCardModule,a.NbCheckboxModule,a.NbAlertModule,a.NbInputModule,a.NbButtonModule,n.RouterModule,i.FormsModule,o.TranslateModule.forRoot()],providers:[L,C,w],exports:[b,I,O]}]}],e}();e.AUTH_DEFAULT_LANG=m,e.GeAdminAuthModule=k,e.LoginComponent=b,e.LoginLangService=w,e.LoginStatus=M,e.LoginStatusService=C,e.LogoutComponent=O,e.NamePasswordAuthStrategyOptions=v,e.NamePasswordStrategyService=L,e.ResetPasswordComponent=I,e.ResultError=P,e.namePasswordStrategyOptions=x,Object.defineProperty(e,"__esModule",{value:!0})}));
  14. //# sourceMappingURL=ge-admin-auth.umd.min.js.map