@ -0,0 +1 @@ |
|||||||
|
<p>examiner-index works!</p> |
@ -1,20 +1,20 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
import { LoginComponent } from './login.component'; |
import { ExaminerIndexComponent } from './examiner-index.component'; |
||||||
|
|
||||||
describe('LoginComponent', () => { |
describe('ExaminerIndexComponent', () => { |
||||||
let component: LoginComponent; |
let component: ExaminerIndexComponent; |
||||||
let fixture: ComponentFixture<LoginComponent>; |
let fixture: ComponentFixture<ExaminerIndexComponent>; |
||||||
|
|
||||||
beforeEach(async(() => { |
beforeEach(async(() => { |
||||||
TestBed.configureTestingModule({ |
TestBed.configureTestingModule({ |
||||||
declarations: [ LoginComponent ] |
declarations: [ ExaminerIndexComponent ] |
||||||
}) |
}) |
||||||
.compileComponents(); |
.compileComponents(); |
||||||
})); |
})); |
||||||
|
|
||||||
beforeEach(() => { |
beforeEach(() => { |
||||||
fixture = TestBed.createComponent(LoginComponent); |
fixture = TestBed.createComponent(ExaminerIndexComponent); |
||||||
component = fixture.componentInstance; |
component = fixture.componentInstance; |
||||||
fixture.detectChanges(); |
fixture.detectChanges(); |
||||||
}); |
}); |
@ -0,0 +1,15 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-examiner-index', |
||||||
|
templateUrl: './examiner-index.component.html', |
||||||
|
styleUrls: ['./examiner-index.component.scss'] |
||||||
|
}) |
||||||
|
export class ExaminerIndexComponent implements OnInit { |
||||||
|
|
||||||
|
constructor() { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,33 +1,31 @@ |
|||||||
<div class="content"> |
<div class="login"> |
||||||
<div class="loginBox"> |
<div class="loginBox"> |
||||||
<h1 class="header">灭火救援指挥培训系统 (管理员)</h1> |
|
||||||
|
|
||||||
<div class="center"> |
<div> |
||||||
|
<div class="card"> |
||||||
|
|
||||||
|
<span class="cardheader">考核系统管理员登录页面</span> |
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
<div class="input"> |
<div class="input"> |
||||||
<mat-icon class="icon">account_box</mat-icon> |
<mat-icon class="icon">account_box</mat-icon> |
||||||
<input id="name" name="name" required ngModel placeholder="请输入用户名" maxlength="18"> |
<input id="name" name="name" required ngModel placeholder="请输入用户名" maxlength="20"> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div class="input"> |
<div class="input"> |
||||||
<mat-icon class="icon2">lock</mat-icon> |
<mat-icon class="icon2">lock</mat-icon> |
||||||
<input id="password" name="password" type='password' required ngModel placeholder="请输入登录密码" maxlength="18"> |
<input id="password" name="password" type='password' required ngModel placeholder="请输入登录密码" maxlength="20"> |
||||||
</div> |
|
||||||
|
|
||||||
<div class="forget"> |
|
||||||
<label (click)='forget()'>忘记密码?</label> |
|
||||||
</div> |
</div> |
||||||
|
|
||||||
<div *ngIf="errmsg" class="alert-danger"> |
<div class="forget"><label (click)='forget()'>忘记密码?</label></div> |
||||||
{{errmsg}} |
<div *ngIf="errmsg" class="alert-danger">{{errmsg}}</div> |
||||||
</div> |
<button type="submit" [disabled]="!form.form.valid" class="loginBtn" mat-raised-button>登录</button> |
||||||
|
<label class="toAdmin" (click)='toAdminLogin()'>返回</label> |
||||||
|
|
||||||
<button type="submit" [disabled]="!form.form.valid" class="loginBtn" mat-raised-button color="primary">登录</button> |
|
||||||
</form> |
</form> |
||||||
|
|
||||||
|
</div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
</div> |
</div> |
||||||
<p class="toLogin" title="教员学员登录" (click)='toAdminLogin()'><mat-icon>arrow_drop_down_circle</mat-icon></p> |
|
||||||
<p class="footer">Copyright <mat-icon style="vertical-align: top; font-size: 20px;">copyright</mat-icon> 2019 北京安信科创软件有限公司出品</p> |
|
||||||
</div> |
</div> |
@ -1,30 +1,34 @@ |
|||||||
<mat-toolbar style="background-color: #3b8cff;"> |
<!-- |
||||||
|
* @Descripttion: |
||||||
|
* @version: |
||||||
|
* @Author: sueRimn |
||||||
|
* @Date: 2020-12-10 10:21:40 |
||||||
|
* @LastEditors: sueRimn |
||||||
|
* @LastEditTime: 2020-12-11 10:01:47 |
||||||
|
--> |
||||||
|
<mat-toolbar style="background-color:#FFFFFF;height: 60px;"> |
||||||
|
|
||||||
<!-- <mat-toolbar> --> |
<!-- <mat-toolbar> --> |
||||||
<p style="color: white;border-bottom: 3px solid #fff;border-radius: 3px; font-size: 16px;padding: 0 4px;">考核系统</p> |
<p>欢迎登录消防救援考核系统</p> |
||||||
|
|
||||||
<!-- 未登录状态 --> |
|
||||||
<!-- <button mat-icon-button class="login" *ngIf="!isLogin.isLogin" (click)='login()'> |
|
||||||
<mat-icon>account_circle</mat-icon> |
|
||||||
</button> --> |
|
||||||
|
|
||||||
<span style="position: absolute;right:100px;color: white;font-size: 16px;">欢迎您,{{realName}}</span> |
|
||||||
<!-- 已登录状态 --> |
<!-- 已登录状态 --> |
||||||
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login"> |
<button mat-icon-button class="login"> |
||||||
<mat-icon>account_circle</mat-icon> |
<mat-icon>account_circle</mat-icon> |
||||||
</button> |
</button> |
||||||
|
<span style="position: absolute;right:80px;color: #1E2323;font-size: 16px;">用户名:{{realName}}<mat-icon [matMenuTriggerFor]="appMenu" style="color: #1E2323;position: relative;top: 8px;cursor: pointer;">keyboard_arrow_down</mat-icon></span> |
||||||
<mat-menu #appMenu="matMenu"> |
<mat-menu #appMenu="matMenu"> |
||||||
<!-- <button mat-menu-item (click)='changeUserData()'> |
<!-- <button mat-menu-item (click)='changeUserData()'> |
||||||
<mat-icon>perm_identity</mat-icon> |
<mat-icon>perm_identity</mat-icon> |
||||||
<span>修改资料</span> |
<span>修改资料</span> |
||||||
</button> --> |
</button> --> |
||||||
<button mat-menu-item (click)='changPassword()'> |
<button mat-menu-item > |
||||||
<mat-icon>verified_user</mat-icon> |
<img style="width: 16px;height: 18px;position: relative;top: 2px;" src="../../assets/images/uppsd.png"> |
||||||
<span>修改密码</span> |
<span style="margin-left: 5px;">修改密码</span> |
||||||
</button> |
</button> |
||||||
<button mat-menu-item (click)='signOut()'> |
<button mat-menu-item (click)='signOut()'> |
||||||
<mat-icon>power_settings_new</mat-icon> |
<img style="width: 16px;height: 18px;position: relative;top: 2px;" src="../../assets/images/sign.png"> |
||||||
<span>退出系统</span> |
<span style="margin-left: 5px;">安全退出</span> |
||||||
</button> |
</button> |
||||||
</mat-menu> |
</mat-menu> |
||||||
|
|
||||||
|
@ -1,29 +0,0 @@ |
|||||||
<div> |
|
||||||
<div class="header"><img src="../../../assets/images/login.gif"></div> |
|
||||||
|
|
||||||
<div class="content"> |
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div class="input"> |
|
||||||
<mat-icon class="icon">account_box</mat-icon> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="name" name="name" required ngModel placeholder="请输入账号"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="input"> |
|
||||||
<mat-icon class="icon2">lock</mat-icon> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="password" name="password" type='password' required ngModel placeholder="请输入密码"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div *ngIf="errmsg" class="alert-danger"> |
|
||||||
{{errmsg}} |
|
||||||
</div> |
|
||||||
|
|
||||||
<button type="submit" [disabled]="!form.form.valid" class="loginBtn" mat-raised-button color="primary">登录</button> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
@ -1,45 +0,0 @@ |
|||||||
.header { |
|
||||||
margin: 0 auto; |
|
||||||
width: 50px; |
|
||||||
height: 50px; |
|
||||||
border-radius: 50%; |
|
||||||
img { |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.content { |
|
||||||
margin: 20px 0; |
|
||||||
text-align: center; |
|
||||||
.alert-danger { |
|
||||||
text-align: left; |
|
||||||
font-size: 14px; |
|
||||||
color: red; |
|
||||||
} |
|
||||||
.loginBtn { |
|
||||||
width: 90%; |
|
||||||
border-radius: 5px; |
|
||||||
margin-top: 10px; |
|
||||||
} |
|
||||||
} |
|
||||||
.input { |
|
||||||
margin-left: 22px; |
|
||||||
position: relative; |
|
||||||
} |
|
||||||
.icon { |
|
||||||
width: 24px; |
|
||||||
color: #666; |
|
||||||
font-size: 24px; |
|
||||||
position: absolute; |
|
||||||
top: 17px; |
|
||||||
left: -24px; |
|
||||||
} |
|
||||||
.icon2 { |
|
||||||
width: 24px; |
|
||||||
color: #666; |
|
||||||
font-size: 24px; |
|
||||||
position: absolute; |
|
||||||
top: 17px; |
|
||||||
left: -24px; |
|
||||||
} |
|
@ -1,42 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
import { HttpClient } from '@angular/common/http'; |
|
||||||
import { IsLoginService } from '../../is-login.service' |
|
||||||
import { CacheTokenService } from '../../http-interceptors/cache-token.service' |
|
||||||
import { MatDialogRef } from '@angular/material/dialog'; |
|
||||||
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-login', |
|
||||||
templateUrl: './login.component.html', |
|
||||||
styleUrls: ['./login.component.scss'] |
|
||||||
}) |
|
||||||
export class LoginComponent implements OnInit { |
|
||||||
|
|
||||||
constructor(private http:HttpClient,private isLogin:IsLoginService,private token:CacheTokenService,public dialogRef: MatDialogRef<any>,public snackBar: MatSnackBar) { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
errmsg:any; //err信息
|
|
||||||
|
|
||||||
//登录
|
|
||||||
onSubmit (e) { |
|
||||||
let loginMsg = { |
|
||||||
name: e.name, |
|
||||||
password: e.password |
|
||||||
} |
|
||||||
this.http.post('/api/Account/SignIn',loginMsg).subscribe((data:any)=>{ |
|
||||||
sessionStorage.setItem("token",data.token); |
|
||||||
sessionStorage.setItem("refreshToken",data.refreshToken); |
|
||||||
this.token.startUp(); //登陆成功启动定时器刷新token
|
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('登陆成功','确定',config); |
|
||||||
this.dialogRef.close(data); |
|
||||||
},(err) => {this.errmsg = err}) |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
After Width: | Height: | Size: 409 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 447 KiB |
Before Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 400 B |