Browse Source

[完善]注册账号重复提示信息

master
邵佳豪 4 years ago
parent
commit
4751be48f4
  1. 2
      src/app/pages/register/register.component.ts
  2. 2
      src/app/ui/all-file/all-file.component.ts
  3. 2
      src/app/ui/changeuserdata/changeuserdata.component.ts
  4. 12
      src/app/ui/enterpriseuser/addenterpriseuser.component.ts
  5. 1
      src/app/ui/enterpriseuser/enterpriseuser.component.ts
  6. 9
      src/app/ui/teacherManagement/addenterpriseuser.component.ts
  7. 4
      src/app/ui/teacherManagement/enterpriseuser.component.ts

2
src/app/pages/register/register.component.ts

@ -13,7 +13,7 @@ export class RegisterComponent implements OnInit {
}
onSubmit(e){
console.log(e)
// console.log(e)
}
}

2
src/app/ui/all-file/all-file.component.ts

@ -240,7 +240,7 @@ export class AllFileComponent {
this.checkedAllFiles.push(item)
}
})
console.log(888888,data.contents)
// console.log(888888,data.contents)
},
err=>{

2
src/app/ui/changeuserdata/changeuserdata.component.ts

@ -16,7 +16,7 @@ export class ChangeuserdataComponent implements OnInit {
//修改资料
onSubmit (e) {
console.log(e)
// console.log(e)
}
}

12
src/app/ui/enterpriseuser/addenterpriseuser.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {MatDialogRef} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@Component({
selector: 'addenterpriseuser',
@ -12,7 +12,7 @@ import {FormControl} from '@angular/forms';
export class AddEnterpriserUser {
toppings = new FormControl();
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddEnterpriserUser>) {}
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddEnterpriserUser>,public snackBar: MatSnackBar) {}
errmsg:any; //捕获错误信息
detachmentPosts: any = []//支队职务列表
brigadePosts: any = []//大队职务列表
@ -24,7 +24,6 @@ export class AddEnterpriserUser {
//获得所有职务
getAllPosts(){
this.http.get("/api/Posts").subscribe( (data:any) =>{
console.log(123,data)
data.forEach(item => {
if(item.name.indexOf("支队级") != -1){
this.detachmentPosts.push(item)
@ -46,7 +45,6 @@ export class AddEnterpriserUser {
postsArr.forEach((item) => {
postsObj.push({id:item, name:""})
})
// console.log(666,postsObj)
let body = {
name : e.idNumber,
realName : e.realName,
@ -55,9 +53,13 @@ export class AddEnterpriserUser {
creationTime : date,
posts : postsObj
}
// console.log(date)
this.http.post("/api/Users",body).subscribe( data => {
this.dialogRef.close(data);
},err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
}

1
src/app/ui/enterpriseuser/enterpriseuser.component.ts

@ -248,7 +248,6 @@ export class editenterpriseuser {
//获得所有职务
getAllPosts(){
this.http.get("/api/Posts").subscribe( (data:any) =>{
console.log(123,data)
data.forEach(item => {
if(item.name.indexOf("支队级") != -1){
this.detachmentPosts.push(item)

9
src/app/ui/teacherManagement/addenterpriseuser.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {MatDialogRef} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@Component({
selector: 'addenterpriseuser',
@ -12,7 +12,7 @@ import {FormControl} from '@angular/forms';
export class AddTeacher {
toppings = new FormControl();
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddTeacher>) {}
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddTeacher>,public snackBar: MatSnackBar) {}
errmsg:any; //捕获错误信息
detachmentPosts: any = []//支队职务列表
brigadePosts: any = []//大队职务列表
@ -55,6 +55,11 @@ export class AddTeacher {
}
this.http.post("/api/Users",body).subscribe( data => {
this.dialogRef.close(data);
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
}

4
src/app/ui/teacherManagement/enterpriseuser.component.ts

@ -64,7 +64,7 @@ export class TeacherManagementComponent implements OnInit {
RoleType: '1',
}
this.http.get('/api/Users',{params:data}).subscribe((data:any)=>{
console.log(666,data)
// console.log(666,data)
this.length = data.totalCount
this.pageSize = data.pageSize
this.pageEvent.pageIndex = 0
@ -244,7 +244,7 @@ export class editTeacher {
//获得所有职务
getAllPosts(){
this.http.get("/api/Posts").subscribe( (data:any) =>{
console.log(123,data)
// console.log(123,data)
data.forEach(item => {
if(item.name.indexOf("支队级") != -1){
this.detachmentPosts.push(item)

Loading…
Cancel
Save