-
-
-
-
-
-

-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss
index cf24354..87b642d 100644
--- a/src/app/pages/login/login.component.scss
+++ b/src/app/pages/login/login.component.scss
@@ -1,115 +1,88 @@
-
-.login {
+.content {
width: 100%;
height: 100%;
- // background: url('../../../assets/images/bg_login.jpg');
-
- .loginbox {
- width: 100%;
- height: 100%;
- background-color: #000;
- background: rgba(0,0,0,0.5);/*盒子背景透明*/
- position: relative;
- }
+ max-height: 100%;
+ background: url('../../../assets//images/loginBackground.jpg');
+ background-repeat:no-repeat;
+ background-size:100% 100%;
+ -moz-background-size:100% 100%;
+}
- .intro {
- width: 35%;
- position: fixed;
- top:35%;
- left: 15%;
- p {
- font-size: 36px;
- color:white;
- margin-bottom: 35px;
- }
- span {
- font-size: 16px;
- color:white;
- opacity: 0.5;
- }
+.loginBox {
+ margin: 0 auto;
+ width: 40%;
+ text-align: center;
+ box-sizing: border-box;
+ padding: 8% 0;
+ .header {
+ font-size: 34px;
+ font-weight: 650;
+ font-family: 'NSimSun';
}
-
- .card{
- width: 460px;
- height: 100%;
- background-color: #fff;
- position: absolute;
- right: 0;
+ .center {
+ padding: 100px 0;
+ width: 50%;
+ box-sizing: border-box;
+ margin: 0 auto;
}
-
}
-
-.example-container {
- display: flex;
- flex-direction: column;
+.footer {
width: 100%;
-}
-.loginbtn {
- margin-top: 25px;
- height: 35px;
- background-color:#039be5;
- border-radius: 15px;
- color: #fff;;
-}
-.mat-card {
- box-shadow: 0 0 0;
- margin-top: 140px;
+ text-align: center;
+ position: fixed;
+ bottom: 35px;
+ color: #858688;
+ font-size: 14px;
}
-.applyfor {
- font-size: 16px;
- a {
- color: #039be5;
- }
-}
-.website {
- font-size: 14px;
- text-align: center;
- margin-top: 60px;
-
+
+// 表单内部样式
+.forget{
+ margin: 30px auto;
+ label {
+ margin-left: 80%;
+ box-sizing: border-box;
+ font-size: 14px;
+ color: #2196f3;
+ cursor:pointer;
+ }
}
.alert-danger {
+ margin-bottom: 30px;
+ text-align: left;
font-size: 14px;
color: red;
}
-.cardheader{
- font-size: 26px;
- font-weight: 500;
- margin-top: 20px;
-}
-.mat-card {
- margin-top: 10px;
- padding-left: 20px;
-}
-.mat-form-field {
- padding-left: 20px;;
-}
-.loginImg {
- margin-top: 90px;
- text-align: center;
+.loginBtn {
+ width: 100%;
}
-.mat-input-element {
+//input 框 + 字体图标
+.input {
+ width: 100%;
+ margin: 30px auto;
position: relative;
+ input {
+ width: 90%;
+ border-radius: 5px;
+ border: 1px solid #999;
+ height: 36px;
+ padding-left: 30px;
+ }
}
-.mat-card .example-container .icon {
+.icon {
width: 24px;
- color: #666;
+ color: #B5BBBC;
font-size: 24px;
position: absolute;
- top:36px;
- left: 15px;
+ top: 7px;
+ left: 8px;
}
-.mat-card .example-container .icon2 {
+.icon2 {
width: 24px;
- color: #666;
+ color: #B5BBBC;
font-size: 24px;
position: absolute;
- top:100px;
- left: 15px;
-}
-a {
- font-size: 14px;
- color: #0066FF;
- margin-left: 250px;
+ top: 7px;
+ left: 8px;
}
\ No newline at end of file
diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts
index 8305988..169654e 100644
--- a/src/app/pages/login/login.component.ts
+++ b/src/app/pages/login/login.component.ts
@@ -1,10 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
-import { Data } from '../../interface'
import { Router,ActivatedRoute } from '@angular/router'
-
+import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
+import { IsLoginService } from '../../is-login.service'//引入服务
import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务
-import { MatSnackBar } from '@angular/material/snack-bar';
+
+
+
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
@@ -13,53 +15,38 @@ import { MatSnackBar } from '@angular/material/snack-bar';
})
export class LoginComponent implements OnInit {
- constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar) { }
+ constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar,private isLogin:IsLoginService) { }
ngOnInit() {
}
- errmsg :string = ''
- onSubmit(e){
- this.http.post(
- '/api/Account/SignIn',
- {
- name: e.name,
- password: e.password
- }
- ).subscribe(
- (data: Data) =>
- {
- sessionStorage.setItem("token",data.token);
- sessionStorage.setItem("refreshToken",data.refreshToken);
- this.router.navigate(['/datacollection'])
+ errmsg :string = ''; //错误信息
- if(e.notlogin){
- console.log("true")
- localStorage.setItem("isnologin","true")
- localStorage.setItem("token",data.token)
- localStorage.setItem("refreshToken",data.refreshToken)
- }else{
- console.log("false")
- }
- //调用服务中的function刷新token
- this.token.startUp()
- //调用服务中的function获取菜单
- },
- (err) =>
- {this.errmsg = err}
- )
+ //登录
+ onSubmit(e){
+ this.http.post('/api/Account/SignIn',e).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.router.navigate(['/home']) //登陆成功跳转页面
+ this.snackBar.open('登陆成功','确定',config);
+ },(err) => {this.errmsg = err})
}
- //打开弹窗
- open () {
- this.snackBar.open('请联系管理员', '确定', {
- duration: 3000
- });
+ //忘记密码弹窗
+ forget () {
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('如果您忘记了密码,请联系管理员重置密码!','确定',config);
}
-
-
+
+
}
diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html
index 84d720c..2e288e2 100644
--- a/src/app/tabbar/tabbar.component.html
+++ b/src/app/tabbar/tabbar.component.html
@@ -4,13 +4,13 @@
指挥长(员)战术战法培训系统
-