From 4c88ea3c05efa5da157dde96565c0a3af75e8ddf Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 21 Mar 2016 10:30:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(perm=5Frole=5Fadd)=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E8=BF=87=E9=95=BF=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82?= =?UTF-8?q?=E5=B8=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修改表结构password长度 2. 修改template添加js验证 --- jperm/models.py | 2 +- templates/jperm/perm_role_add.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jperm/models.py b/jperm/models.py index 425d01410..0ba12354a 100644 --- a/jperm/models.py +++ b/jperm/models.py @@ -26,7 +26,7 @@ class PermSudo(models.Model): class PermRole(models.Model): name = models.CharField(max_length=100, unique=True) comment = models.CharField(max_length=100, null=True, blank=True, default='') - password = models.CharField(max_length=100) + password = models.CharField(max_length=128) key_path = models.CharField(max_length=100) date_added = models.DateTimeField(auto_now=True) sudo = models.ManyToManyField(PermSudo, related_name='perm_role') diff --git a/templates/jperm/perm_role_add.html b/templates/jperm/perm_role_add.html index 59ec3b3b6..9928afa80 100644 --- a/templates/jperm/perm_role_add.html +++ b/templates/jperm/perm_role_add.html @@ -104,6 +104,10 @@ $('#roleForm').validator({ ok: "", msg: {required: "系统用户名称必填"} }, + "role_password": { + rule: "length[0~64]", + tip: "系统密码" + }, "role_key": { rule: "check_begin", ok: "", From 6e4b2918089e199da456fe2e61e67db77e358d68 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 21 Mar 2016 10:32:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(perm=5Frole=5Fedit)=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BC=96=E8=BE=91=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=BF=87=E9=95=BFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 添加前端验证 close #173 --- templates/jperm/perm_role_edit.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/jperm/perm_role_edit.html b/templates/jperm/perm_role_edit.html index 420eb300a..8ad8ed973 100644 --- a/templates/jperm/perm_role_edit.html +++ b/templates/jperm/perm_role_edit.html @@ -105,12 +105,16 @@ $('#roleForm').validator({ tip: "输入系统用户名称", ok: "", msg: {required: "系统用户名称必填"} + }, + "role_password": { + rule: "length[0~64]", + tip: "系统密码" }, "role_key": { rule: "check_begin", ok: "", empty: true - }, + } }, valid: function(form) {