[feat] update login page

main
Johnson C 2 years ago
parent d9a10d225f
commit 9e55dd6166

@ -9,7 +9,6 @@ import {
} from '@angular/common/http';
import { Injectable, Injector } from '@angular/core';
import { Router } from '@angular/router';
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
import { ALAIN_I18N_TOKEN, _HttpClient } from '@delon/theme';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { Observable, of, throwError } from 'rxjs';
@ -63,10 +62,6 @@ export class DefaultInterceptor implements HttpInterceptor {
if (!headers?.has('Accept-Language') && lang) {
res['Accept-Language'] = lang;
}
const token = this.injector.get<ITokenService>(DA_SERVICE_TOKEN).get()?.token
if (token) {
res['Authorization'] = 'Bearer ' + token;
}
return res;
}

@ -18,7 +18,12 @@ const alainConfig: AlainConfig = {
license: `A59B099A586B3851E0F0D7FDBF37B603`,
licenseA: `C94CEE276DB2187AE6B65D56B3FC2848`
},
auth: { login_url: '/passport/login' }
auth: {
login_url: '/passport/login',
token_send_key: 'Authorization',
token_send_template: 'Bearer ${token}',
ignores: [/\/login/, /assets\//, /passport\//, /\/version/,],
}
};
const alainModules: any[] = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()];

@ -2,9 +2,14 @@
<div class="wrap">
<div class="top">
<div class="head">
<span class="title" >Go Micro Dashboard</span>
<img class="logo" src="./assets/logo-color.png">
<p class="title">Go Micro Dashboard</p>
</div>
</div>
<router-outlet></router-outlet>
<global-footer>
<a href="https://github.com/xpunch" target="_blank">X Punch</a>
<p>{{version}}</p>
</global-footer>
</div>
</div>
</div>

@ -51,8 +51,10 @@
}
}
.logo {
height: 44px;
height: 96px;
margin-right: 16px;
margin-top: 64px;
margin-bottom: 16px;
}
.title {
position: relative;

@ -1,5 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core';
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
import { ServiceProxy } from 'src/app/shared/service-proxies/service-proxies';
@Component({
selector: 'layout-passport',
@ -7,9 +8,14 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
styleUrls: ['./passport.component.less']
})
export class LayoutPassportComponent implements OnInit {
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {}
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, private readonly service: ServiceProxy) { }
version: string = '';
ngOnInit(): void {
this.tokenService.clear();
this.service.getVersion().subscribe(resp => {
this.version = resp.version;
});
}
}

@ -1,23 +1,19 @@
<form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
<nz-tabset [nzAnimated]="false" class="tabs" (nzSelectChange)="switch($event)">
<nz-tab [nzTitle]="'Credentials'" style="margin:auto;">
<nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter username">
<nz-input-group nzSize="large" nzPrefixIcon="user">
<input nz-input formControlName="username" placeholder="username" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter password">
<nz-input-group nzSize="large" nzPrefixIcon="lock">
<input nz-input type="password" formControlName="password" placeholder="password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</nz-tab>
</nz-tabset>
<nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter username">
<nz-input-group nzSize="large" nzPrefixIcon="user">
<input nz-input formControlName="username" placeholder="username" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control nzErrorTip="Please enter password">
<nz-input-group nzSize="large" nzPrefixIcon="lock">
<input nz-input type="password" formControlName="password" placeholder="password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-col [nzSpan]="12">
<label nz-checkbox formControlName="remember">Remember me</label>

@ -1,11 +1,9 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnDestroy, Optional } from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Optional } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { StartupService } from '@core';
import { ReuseTabService } from '@delon/abc/reuse-tab';
import { DA_SERVICE_TOKEN, ITokenService, SocialOpenType, SocialService } from '@delon/auth';
import { SettingsService, _HttpClient } from '@delon/theme';
import { environment } from '@env/environment';
import { DA_SERVICE_TOKEN, ITokenService, SocialService } from '@delon/auth';
import { NzTabChangeEvent } from 'ng-zorro-antd/tabs';
import { finalize } from 'rxjs/operators';
import { AccountServiceProxy, LoginRequest } from 'src/app/shared/service-proxies/service-proxies';
@ -21,14 +19,11 @@ export class UserLoginComponent {
constructor(
fb: FormBuilder,
private router: Router,
private settingsService: SettingsService,
private socialService: SocialService,
@Optional()
@Inject(ReuseTabService)
private reuseTabService: ReuseTabService,
@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService,
private startupSrv: StartupService,
private http: _HttpClient,
private cdr: ChangeDetectorRef,
private accountService: AccountServiceProxy,
) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

@ -39,7 +39,7 @@ func Register(opts Options) error {
registry.NewRouteRegistrar(opts.Client.Options().Registry),
statistics.NewRouteRegistrar(opts.Client.Options().Registry),
} {
r.RegisterRoute(router)
r.RegisterRoute(router.Group(""))
}
return nil
}

@ -1,5 +1,5 @@
// Code generated by fileb0x at "2021-12-06 16:07:20.7620288 +0800 CST m=+0.057977901" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(c5c686d71f073ae93607fbb8175a0459.8be3f833d63e3c844663716446e13a42)
// Code generated by fileb0x at "2021-12-07 09:55:11.5785541 +0800 CST m=+0.055981701" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(209b6e4a4c2db20cc1b8cc7bd8940d7d.8be3f833d63e3c844663716446e13a42)
package web

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-12-06 16:07:20.9364284 +0800 CST m=+0.232377501" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-06 16:07:15.9565685 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 09:55:11.5815524 +0800 CST m=+0.058980001" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 09:55:07.3042721 +0800 CST)
// original path: frontend\dist\449.ea3505f8c3a78bc5ec51.js
package web

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-12-06 16:07:20.8928978 +0800 CST m=+0.188846901" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-06 16:07:15.9555753 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 09:55:11.5835486 +0800 CST m=+0.060976201" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 09:55:07.3032709 +0800 CST)
// original path: frontend\dist\polyfills.d3127c390f57a23419e1.js
package web

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-12-06 16:07:20.8966333 +0800 CST m=+0.192582401" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-06 16:07:15.9555753 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 09:55:11.5886369 +0800 CST m=+0.066064501" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 09:55:07.3042721 +0800 CST)
// original path: frontend\dist\runtime.0edec77bcc0e6f764d02.js
package web

@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-12-06 16:07:20.8977526 +0800 CST m=+0.193701701" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-06 16:07:15.9565685 +0800 CST)
// Code generaTed by fileb0x at "2021-12-07 09:55:11.5896313 +0800 CST m=+0.067058901" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-07 09:55:07.305269 +0800 CST)
// original path: frontend\dist\styles.40a72a43f1959e5b9ccc.css
package web

Loading…
Cancel
Save