소스 검색

系统安全开发

maotao 1 개월 전
부모
커밋
19887f03fa

+ 4 - 4
src/app/components/configurationCenter/configuration-system-security/configuration-system-security.component.html

@@ -55,20 +55,20 @@
55 55
 								</div>
56 56
 
57 57
 								<!-- 是否限制单点登录ip -->
58
-								<div class="display_flex align-items_center mb8">
58
+						<!-- 		<div class="display_flex align-items_center mb8">
59 59
 								  <nz-form-label class="label">是否限制单点登录ip</nz-form-label>
60 60
 								  <nz-checkbox-group [(ngModel)]="astrictIp"></nz-checkbox-group>
61
-								</div>
61
+								</div> -->
62 62
 
63 63
                 <!-- 单点登录范围内IP -->
64
-                <div class="display_flex flex-wrap_wrap align-items_baseline mb8" *ngIf="astrictIp[0].checked">
64
+               <!-- <div class="display_flex flex-wrap_wrap align-items_baseline mb8" *ngIf="astrictIp[0].checked">
65 65
                   <nz-form-label class="label">单点登录范围内IP</nz-form-label>
66 66
 									<div *ngFor="let i of ipData let index = index;" class="ip-list" [ngClass]="{'margin-list':index!=0}">
67 67
 										<input class="width-300" type="text" nz-input [(ngModel)]="i.rangeIp"/> 
68 68
 										<i class="add-class" (click)="addIp()" nz-icon nzType="plus" nzTheme="outline"></i>
69 69
 										<i class="add-class" (click)="delIp(i, index)" nz-icon nzType="minus" nzTheme="outline"></i>
70 70
 									</div>
71
-								</div>
71
+								</div> -->
72 72
               </div>
73 73
               <div class="bottom">
74 74
                 <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>

+ 32 - 32
src/app/components/configurationCenter/configuration-system-security/configuration-system-security.component.ts

@@ -109,13 +109,13 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
109 109
 			}
110 110
 		}
111 111
 	
112
-		if(this.astrictIp[0].checked){
113
-			let isEmpty = this.ipData.filter(i=>i.rangeIp=='')
114
-			if(isEmpty.length>0){
115
-				this.msg.error('ip不能为空')
116
-				return 
117
-			}
118
-		}
112
+		// if(this.astrictIp[0].checked){
113
+		// 	let isEmpty = this.ipData.filter(i=>i.rangeIp=='')
114
+		// 	if(isEmpty.length>0){
115
+		// 		this.msg.error('ip不能为空')
116
+		// 		return 
117
+		// 	}
118
+		// }
119 119
 		
120 120
 		let filterData = this.initConfig;
121 121
 		filterData.forEach((item) => {
@@ -142,20 +142,20 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
142 142
 		  }else if (item.configKey === "incorrectNum") {
143 143
 				item.configValue = this.errorTime;
144 144
 		  }else if (item.configKey === "limitSingleLoginIp") {
145
-				let value = null
146
-				if(this.astrictIp[0].checked){
147
-					value = '1'
148
-				}else{
149
-					value = '0'
150
-				}
151
-				item.configValue = value;
145
+				// let value = null
146
+				// if(this.astrictIp[0].checked){
147
+				// 	value = '1'
148
+				// }else{
149
+				// 	value = '0'
150
+				// }
151
+				// item.configValue = value;
152 152
 		  }else if (item.configKey === "ipWhiteList") {
153
-				let str = JSON.parse(JSON.stringify(this.ipData))
154
-				let data = str.map(i=>{
155
-					return i.rangeIp
156
-				})
157
-				console.log(4444, data)
158
-				item.configValue = data.join(';');
153
+				// let str = JSON.parse(JSON.stringify(this.ipData))
154
+				// let data = str.map(i=>{
155
+				// 	return i.rangeIp
156
+				// })
157
+				// console.log(4444, data)
158
+				// item.configValue = data.join(';');
159 159
 		  }
160 160
 		});
161 161
 		const postData = filterData;
@@ -220,20 +220,20 @@ export class ConfigurationSystemSecurityComponent implements OnInit {
220 220
 									this.errorTime = c[1]
221 221
 									break;	
222 222
 								case "limitSingleLoginIp":
223
-									if(c[1]=='1'){
224
-										this.astrictIp[0].checked = true
225
-									}else{
226
-										this.astrictIp[0].checked = false
227
-									}
223
+									// if(c[1]=='1'){
224
+									// 	this.astrictIp[0].checked = true
225
+									// }else{
226
+									// 	this.astrictIp[0].checked = false
227
+									// }
228 228
 									break;
229 229
 								case "ipWhiteList":
230
-									let data = c[1].split(';')
231
-									this.ipData = []
232
-									for(let i=0; i<data.length; i++){
233
-										this.ipData.push({
234
-											rangeIp: data[i]
235
-										}) 
236
-									}
230
+									// let data = c[1].split(';')
231
+									// this.ipData = []
232
+									// for(let i=0; i<data.length; i++){
233
+									// 	this.ipData.push({
234
+									// 		rangeIp: data[i]
235
+									// 	}) 
236
+									// }
237 237
 									break;
238 238
 							}
239 239
 						});

+ 21 - 18
src/app/views/login/login.component.ts

@@ -82,19 +82,19 @@ export class LoginComponent implements OnInit {
82 82
       (data) => {
83 83
         this.loading = false;
84 84
         this.msg.remove(loadingId);
85
-				if(data.status==200){
86
-					this.apiLogin(data.userId, data.pwd, "", "", true);
87
-				}else{
85
+				if(data.status==500){
88 86
 					this.msg.error(data.remarks, {
89
-					  nzDuration: 1000,
87
+					  nzDuration: 2000,
90 88
 					});
89
+				}else{
90
+					this.apiLogin(data.userId, data.pwd, "", "", true);
91 91
 				}
92 92
       },
93 93
       (err) => {
94 94
         this.loading = false;
95 95
         this.msg.remove(loadingId);
96 96
         this.msg.error("登录失败", {
97
-          nzDuration: 1000,
97
+          nzDuration: 2000,
98 98
         });
99 99
         this.router.navigateByUrl("/login");
100 100
       }
@@ -271,17 +271,20 @@ export class LoginComponent implements OnInit {
271 271
 				this.errorTip = null;
272 272
       } else if(data.status == 501){
273 273
 				this.msg.error('验证码错误', {
274
-				  nzDuration: 1000,
274
+				  nzDuration: 2000,
275 275
 				});
276 276
 				this.errorTip = null;
277 277
       } else if(data.status == 506){
278 278
 				this.errorTip = data.tips
279
+				this.msg.error(data.remarks, {
280
+				  nzDuration: 2000,
281
+				});
279 282
 				this.resetCode()
280 283
       }else {
281 284
 				this.errorTip = null;
282 285
 				this.resetCode()
283 286
 				this.msg.error(data.remarks, {
284
-				  nzDuration: 1000,
287
+				  nzDuration: 2000,
285 288
 				});
286 289
 			}
287 290
     });
@@ -332,7 +335,7 @@ export class LoginComponent implements OnInit {
332 335
 		localStorage.setItem("specimenBatchNo",'')
333 336
 		if(this.paramsData.toPage1 && (this.paramsData.cardNO1 || this.paramsData.pathologyFormCode1)){
334 337
 			this.msg.success("登录成功!", {
335
-			  nzDuration: 1000,
338
+			  nzDuration: 2000,
336 339
 			});
337 340
 			successLoginMsg = false;
338 341
 			localStorage.setItem("user", JSON.stringify(data.user));
@@ -354,7 +357,7 @@ export class LoginComponent implements OnInit {
354 357
       // 护士角色跳护士端
355 358
       if (successLoginMsg) {
356 359
         this.msg.success("登录成功!", {
357
-          nzDuration: 1000,
360
+          nzDuration: 2000,
358 361
         });
359 362
       }
360 363
       successLoginMsg = false;
@@ -366,7 +369,7 @@ export class LoginComponent implements OnInit {
366 369
       // 调度台
367 370
       if (successLoginMsg) {
368 371
         this.msg.success("登录成功!", {
369
-          nzDuration: 1000,
372
+          nzDuration: 2000,
370 373
         });
371 374
       }
372 375
       successLoginMsg = false;
@@ -377,7 +380,7 @@ export class LoginComponent implements OnInit {
377 380
       // 标本间端
378 381
       if (successLoginMsg) {
379 382
         this.msg.success("登录成功!", {
380
-          nzDuration: 1000,
383
+          nzDuration: 2000,
381 384
         });
382 385
       }
383 386
       successLoginMsg = false;
@@ -388,7 +391,7 @@ export class LoginComponent implements OnInit {
388 391
       // 门诊病理采样端
389 392
       if (successLoginMsg) {
390 393
         this.msg.success("登录成功!", {
391
-          nzDuration: 1000,
394
+          nzDuration: 2000,
392 395
         });
393 396
       }
394 397
       successLoginMsg = false;
@@ -399,7 +402,7 @@ export class LoginComponent implements OnInit {
399 402
       // 病理交接本
400 403
       if (successLoginMsg) {
401 404
         this.msg.success("登录成功!", {
402
-          nzDuration: 1000,
405
+          nzDuration: 2000,
403 406
         });
404 407
       }
405 408
       successLoginMsg = false;
@@ -410,7 +413,7 @@ export class LoginComponent implements OnInit {
410 413
       // 病理科端
411 414
       if (successLoginMsg) {
412 415
         this.msg.success("登录成功!", {
413
-          nzDuration: 1000,
416
+          nzDuration: 2000,
414 417
         });
415 418
       }
416 419
       successLoginMsg = false;
@@ -421,7 +424,7 @@ export class LoginComponent implements OnInit {
421 424
       // web报修
422 425
       if (successLoginMsg) {
423 426
         this.msg.success("登录成功!", {
424
-          nzDuration: 1000,
427
+          nzDuration: 2000,
425 428
         });
426 429
       }
427 430
       successLoginMsg = false;
@@ -432,7 +435,7 @@ export class LoginComponent implements OnInit {
432 435
       // 药房端2
433 436
       if (successLoginMsg) {
434 437
         this.msg.success("登录成功!", {
435
-          nzDuration: 1000,
438
+          nzDuration: 2000,
436 439
         });
437 440
       }
438 441
       successLoginMsg = false;
@@ -443,12 +446,12 @@ export class LoginComponent implements OnInit {
443 446
     // 有菜单可以进入系统主页面
444 447
     if (!canLogin) {
445 448
       this.msg.success("暂无权限进入系统!", {
446
-        nzDuration: 1000,
449
+        nzDuration: 2000,
447 450
       });
448 451
     } else {
449 452
       if (successLoginMsg) {
450 453
         this.msg.success("登录成功!", {
451
-          nzDuration: 1000,
454
+          nzDuration: 2000,
452 455
         });
453 456
       }
454 457
       successLoginMsg = false;