LdapContext test
This commit is contained in:
@@ -78,4 +78,18 @@ export class LdapContextComponent implements OnInit {
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
onTest(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.form.submitting = true;
|
||||
this.ldapContextService.test(this.form.model).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.test.success'));
|
||||
} else {
|
||||
this.msg.error(this.i18n.fanyi('mxk.alert.test.error'));
|
||||
}
|
||||
this.form.submitting = false;
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
@@ -36,6 +35,7 @@ export class BaseService<T> {
|
||||
add: string;
|
||||
update: string;
|
||||
delete: string;
|
||||
test: string;
|
||||
tree: string;
|
||||
member: string;
|
||||
memberOut: string;
|
||||
@@ -49,6 +49,7 @@ export class BaseService<T> {
|
||||
load: '/load',
|
||||
update: '/update',
|
||||
delete: '/delete',
|
||||
test: '/test',
|
||||
tree: '/tree',
|
||||
member: '/member',
|
||||
memberOut: '/memberOut'
|
||||
@@ -108,6 +109,16 @@ export class BaseService<T> {
|
||||
return this.http.delete<Message<T>>(`${this.server.urls.base + this.server.urls.delete}?ids=${ids}`);
|
||||
}
|
||||
|
||||
test(params: NzSafeAny, testURL?: string): Observable<Message<T>> {
|
||||
let _testURL = '';
|
||||
if (testURL) {
|
||||
_testURL = testURL;
|
||||
} else {
|
||||
_testURL = `${this.server.urls.base + this.server.urls.test}`;
|
||||
}
|
||||
return this.http.get<Message<T>>(_testURL, { params: this.parseParams(params) });
|
||||
}
|
||||
|
||||
tree(params: NzSafeAny): Observable<Message<any>> {
|
||||
return this.http.get<Message<any>>(this.server.urls.base + this.server.urls.tree, {
|
||||
params: this.parseParams(params)
|
||||
|
||||
@@ -455,7 +455,20 @@
|
||||
},
|
||||
"roles": {
|
||||
"name": "Role Name",
|
||||
"dynamic": "Dynamic",
|
||||
"type": {
|
||||
"":"Member Type",
|
||||
"user":"User",
|
||||
"user-dynamic":"User-Dynamic",
|
||||
"post":"Post"
|
||||
},
|
||||
"member": "Member",
|
||||
"permissions": "Permissions",
|
||||
"category": {
|
||||
"":"Category",
|
||||
"dynamic":"Dynamic",
|
||||
"static":"Static",
|
||||
"app":"App"
|
||||
},
|
||||
"filters": "Attributes Filter",
|
||||
"orgIdsList": "Dept List",
|
||||
"resumeTime": "Join Time",
|
||||
@@ -643,6 +656,10 @@
|
||||
"success":"Delete Success!",
|
||||
"error":"Delete Error!"
|
||||
},
|
||||
"test":{
|
||||
"success":"Test Success!",
|
||||
"error":"Test Error!"
|
||||
},
|
||||
"operate":{
|
||||
"success":"Operate Success!",
|
||||
"error":"Operate Error!"
|
||||
@@ -662,6 +679,7 @@
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"test": "Test",
|
||||
"select": "Select",
|
||||
"confirm": "Confirm",
|
||||
"synchr": "Synchr",
|
||||
|
||||
@@ -453,7 +453,20 @@
|
||||
},
|
||||
"roles": {
|
||||
"name": "角色名称",
|
||||
"dynamic": "动态角色",
|
||||
"type": {
|
||||
"":"成员类型",
|
||||
"user":"用户",
|
||||
"user-dynamic":"用户-动态",
|
||||
"post":"岗位"
|
||||
},
|
||||
"member": "成员",
|
||||
"permissions": "访问权限",
|
||||
"category": {
|
||||
"":"类型",
|
||||
"dynamic":"动态",
|
||||
"static":"静态",
|
||||
"app":"应用"
|
||||
},
|
||||
"filters": "属性过滤器",
|
||||
"orgIdsList": "部门列表",
|
||||
"resumeTime": "加入时间",
|
||||
@@ -637,6 +650,10 @@
|
||||
"success":"更新成功!",
|
||||
"error":"更新失败!"
|
||||
},
|
||||
"test":{
|
||||
"success":"测试成功!",
|
||||
"error":"测试失败!"
|
||||
},
|
||||
"delete":{
|
||||
"success":"删除成功!",
|
||||
"error":"删除失败!"
|
||||
@@ -659,6 +676,7 @@
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"test": "测试",
|
||||
"select": "选择",
|
||||
"confirm": "确定",
|
||||
"synchr": "同步",
|
||||
|
||||
@@ -454,7 +454,20 @@
|
||||
},
|
||||
"roles": {
|
||||
"name": "角色名稱",
|
||||
"dynamic": "動態角色",
|
||||
"type": {
|
||||
"":"成員類型",
|
||||
"user":"用戶",
|
||||
"user-dynamic":"用戶-動態",
|
||||
"post":"崗位"
|
||||
},
|
||||
"member": "成員",
|
||||
"permissions": "存取控制",
|
||||
"category": {
|
||||
"":"類型",
|
||||
"dynamic":"動態",
|
||||
"static":"靜態",
|
||||
"app":"應用"
|
||||
},
|
||||
"filters": "屬性過濾器",
|
||||
"orgIdsList": "部門列表",
|
||||
"resumeTime": "加入時間",
|
||||
@@ -642,6 +655,10 @@
|
||||
"success":"删除成功!",
|
||||
"error":"删除失敗!"
|
||||
},
|
||||
"test":{
|
||||
"success":"測試成功!",
|
||||
"error":"測試失敗!"
|
||||
},
|
||||
"operate":{
|
||||
"success":"操作成功!",
|
||||
"error":"操作失敗!"
|
||||
@@ -660,6 +677,7 @@
|
||||
"add": "新增",
|
||||
"edit": "編輯",
|
||||
"delete": "刪除",
|
||||
"test": "測試",
|
||||
"select": "選擇",
|
||||
"confirm": "確定",
|
||||
"synchr": "同步",
|
||||
|
||||
Reference in New Issue
Block a user