view password

This commit is contained in:
caoqianming 2020-06-22 21:59:22 +08:00
parent b15dc5443c
commit 79db239eee
3 changed files with 16 additions and 0 deletions

View File

@ -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) { function totalTextFormatter(data) {

View File

@ -31,6 +31,7 @@ urlpatterns = [
path('api/riskChart',views.riskChart), path('api/riskChart',views.riskChart),
path('api/trainChart',views.trainChart), path('api/trainChart',views.trainChart),
path('api/examChart',views.examChart), path('api/examChart',views.examChart),
path('api/admininfo/<int:id>/', views.admininfo),
path('rbac/role/', views_rbac.RoleView.as_view(), name='rbac_role'), path('rbac/role/', views_rbac.RoleView.as_view(), name='rbac_role'),

View File

@ -240,6 +240,9 @@ def company_userdetail(request, uid):
return render(request, 'groups/company_userdetail.html', locals()) 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): def groups_userupdate(request):
if request.method == 'POST': if request.method == 'POST':