You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
4 years ago
|
import { Component, OnInit } from '@angular/core';
|
||
|
import { HttpClient } from '@angular/common/http'
|
||
|
import { MatDialogRef } from '@angular/material/dialog';
|
||
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
|
||
|
|
||
|
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-changepassword',
|
||
|
templateUrl: './changepassword.component.html',
|
||
|
styleUrls: ['./changepassword.component.scss']
|
||
|
})
|
||
|
|
||
|
export class ChangepasswordComponent implements OnInit {
|
||
|
|
||
|
constructor(private http:HttpClient,public snackBar: MatSnackBar,
|
||
|
public dialogRef: MatDialogRef<ChangepasswordComponent>) { }
|
||
|
|
||
|
ngOnInit() {
|
||
|
}
|
||
|
errmsg :string = ''
|
||
|
|
||
|
onSubmit(e){
|
||
|
this.http.put(
|
||
|
'/api/CompanyAccount/Password',
|
||
|
{
|
||
|
newPassword: e.newPassword,
|
||
|
password: e.password
|
||
|
}
|
||
|
).subscribe(data=> {
|
||
|
this.dialogRef.close(data);
|
||
|
const config = new MatSnackBarConfig();
|
||
|
config.verticalPosition = 'top';
|
||
|
config.duration = 3000
|
||
|
this.snackBar.open('密码修改成功','确定',config);
|
||
|
},(err) =>
|
||
|
{this.errmsg = err}
|
||
|
)
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|