diff --git a/groups/templates/groups/company.html b/groups/templates/groups/company.html
index c1f7e415..4fd830b4 100644
--- a/groups/templates/groups/company.html
+++ b/groups/templates/groups/company.html
@@ -107,6 +107,18 @@
}
});
},
+ 'click .viewpw': function (e, value, row, index) {
+ $.ajax({
+ type: "get",
+ url: "/groups/api/admininfo/"+row.partid+'/',
+ data: {},
+ //async: false, // ajax同步使用false
+ success: function (data) {
+ layer.alert(data.username + '/'+data.password)
+
+ }
+ });
+ },
}
function totalTextFormatter(data) {
diff --git a/groups/urls.py b/groups/urls.py
index ecb9c08e..19764c5c 100644
--- a/groups/urls.py
+++ b/groups/urls.py
@@ -31,6 +31,7 @@ urlpatterns = [
path('api/riskChart',views.riskChart),
path('api/trainChart',views.trainChart),
path('api/examChart',views.examChart),
+ path('api/admininfo//', views.admininfo),
path('rbac/role/', views_rbac.RoleView.as_view(), name='rbac_role'),
diff --git a/groups/views.py b/groups/views.py
index 5ca75160..bd3300fd 100644
--- a/groups/views.py
+++ b/groups/views.py
@@ -240,6 +240,9 @@ def company_userdetail(request, uid):
return render(request, 'groups/company_userdetail.html', locals())
+def admininfo(request, id):
+ user = s_models.User.objects.get(ubelongpart__partid=id,issuper=1)
+ return JsonResponse({'username':user.username,'password':user.password})
def groups_userupdate(request):
if request.method == 'POST':