验证,样式调整等

This commit is contained in:
吕金泽
2022-02-05 17:20:12 +08:00
parent 854a860aa7
commit 0edba9b3cc
16 changed files with 167 additions and 85 deletions
@@ -5,7 +5,7 @@
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
"name" : "保存",
"createTime" : null,
"updateTime" : 1634734554311,
"updateTime" : 1644046408348,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -23,4 +23,8 @@
}
}
================================
var typeCount = db.selectInt("select count(1) from sys_dict where is_del = 0 and type = #{data.type} ?{id, and id != #{data.id}}")
if(typeCount > 0){
exit 0,'类型已存在'
}
return db.table("sys_dict").primary("id").saveOrUpdate(data)
@@ -5,7 +5,7 @@
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
"name" : "保存",
"createTime" : null,
"updateTime" : 1634735495162,
"updateTime" : 1644046552214,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -23,4 +23,8 @@
}
}
================================
var valueCount = db.selectInt("select count(1) from sys_dict_items where is_del = 0 and dict_id = #{data.dictId} and value = #{data.value} ?{id, and id != #{data.id}}")
if(valueCount > 0){
exit 0,'值已存在'
}
return db.table("sys_dict_items").primary("id").saveOrUpdate(data)
@@ -5,7 +5,7 @@
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
"name" : "保存",
"createTime" : null,
"updateTime" : 1643710594405,
"updateTime" : 1644046192172,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -24,6 +24,11 @@
import cn.dev33.satoken.secure.SaSecureUtil;
import org.ssssssss.magicapi.cache.SqlCache
var usernameCount = db.selectInt("select count(1) from sys_user where is_del = 0 and username = #{username} ?{id, and id != #{id}}")
if(usernameCount > 0){
exit 0,'登录名称已存在'
}
password = password ? SaSecureUtil.sha256(password) : ''
var user = {
id,
@@ -5,7 +5,7 @@
"groupId" : "8295fc13678d4144bf7363c465247a50",
"name" : "保存",
"createTime" : null,
"updateTime" : 1641732020139,
"updateTime" : 1644046432007,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -23,4 +23,8 @@
}
}
================================
var codeCount = db.selectInt("select count(1) from sys_office where is_del = 0 and code = #{code} ?{id, and id != #{id}}")
if(codeCount > 0){
exit 0,'机构编码已存在'
}
return db.table("sys_office").primary("id").saveOrUpdate(data);
@@ -5,7 +5,7 @@
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "保存",
"createTime" : null,
"updateTime" : 1641219427227,
"updateTime" : 1644031443910,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -26,6 +26,19 @@
import org.ssssssss.magicapi.cache.SqlCache;
import '@get:/menu/cache/delete' as cacheDelete;
if(data.url){
var urlCount = db.selectInt("select count(1) from sys_menu where is_del = 0 and url = #{data.url} ?{data.id, and id != #{data.id}}")
if(urlCount > 0){
exit 0,'菜单链接已存在'
}
}
if(data.permission){
var permissionCount = db.selectInt("select count(1) from sys_menu where is_del = 0 and permission = #{data.permission} ?{data.id, and id != #{data.id}}")
if(permissionCount > 0){
exit 0,'权限标识已存在'
}
}
SqlCache.delete('permissions:1')
if(data.id){
var menuId = data.id
@@ -5,7 +5,7 @@
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
"name" : "保存",
"createTime" : null,
"updateTime" : 1642326331841,
"updateTime" : 1644046445441,
"lock" : "0",
"method" : "POST",
"path" : "/save",
@@ -25,6 +25,11 @@
================================
import '@get:/role/cache/delete' as cacheDelete
var codeCount = db.selectInt("select count(1) from sys_role where is_del = 0 and code = #{code} ?{id, and id != #{id}}")
if(codeCount > 0){
exit 0,'角色编码已存在'
}
var role = {
code,
permission,