角色权限唯一校验
This commit is contained in:
@ -64,6 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where role_name=#{roleName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="RoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where role_key=#{roleKey}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleById" parameterType="Long">
|
||||
delete from sys_role where role_id = #{roleId}
|
||||
</delete>
|
||||
|
@ -98,6 +98,20 @@
|
||||
},
|
||||
roleKey:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: ctx + "system/role/checkRoleKeyUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"roleName" : function() {
|
||||
return $.trim($("#roleName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
if (data == "0") return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
roleSort:{
|
||||
required:true,
|
||||
@ -106,7 +120,10 @@
|
||||
},
|
||||
messages: {
|
||||
"roleName": {
|
||||
remote: "角色已经存在"
|
||||
remote: "角色名称已经存在"
|
||||
},
|
||||
"roleKey": {
|
||||
remote: "角色权限已经存在"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
|
@ -102,6 +102,23 @@
|
||||
},
|
||||
roleKey:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: ctx + "system/role/checkRoleKeyUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"roleId": function() {
|
||||
return $("input[name='roleId']").val();
|
||||
},
|
||||
"roleKey": function() {
|
||||
return $("input[name='roleKey']").val();
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
if (data == "0") return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
roleSort:{
|
||||
required:true,
|
||||
@ -110,7 +127,10 @@
|
||||
},
|
||||
messages: {
|
||||
"roleName": {
|
||||
remote: "角色已经存在"
|
||||
remote: "角色名称已经存在"
|
||||
},
|
||||
"roleKey": {
|
||||
remote: "角色权限已经存在"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
|
Reference in New Issue
Block a user