Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
ebb9f15a
提交
ebb9f15a
authored
10月 30, 2022
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增返回警告消息提示
上级
cd137bd9
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
127 行增加
和
77 行删除
+127
-77
SysOperlogController.java
...om/ruoyi/web/controller/monitor/SysOperlogController.java
+1
-1
SysUserOnlineController.java
...ruoyi/web/controller/monitor/SysUserOnlineController.java
+1
-1
SysConfigController.java
.../com/ruoyi/web/controller/system/SysConfigController.java
+5
-5
SysDeptController.java
...va/com/ruoyi/web/controller/system/SysDeptController.java
+9
-9
SysDictDataController.java
...om/ruoyi/web/controller/system/SysDictDataController.java
+2
-2
SysDictTypeController.java
...om/ruoyi/web/controller/system/SysDictTypeController.java
+5
-5
SysMenuController.java
...va/com/ruoyi/web/controller/system/SysMenuController.java
+10
-10
SysNoticeController.java
.../com/ruoyi/web/controller/system/SysNoticeController.java
+1
-1
SysPostController.java
...va/com/ruoyi/web/controller/system/SysPostController.java
+6
-6
SysProfileController.java
...com/ruoyi/web/controller/system/SysProfileController.java
+9
-9
SysRoleController.java
...va/com/ruoyi/web/controller/system/SysRoleController.java
+8
-8
SysUserController.java
...va/com/ruoyi/web/controller/system/SysUserController.java
+8
-8
HttpStatus.java
...n/src/main/java/com/ruoyi/common/constant/HttpStatus.java
+5
-0
BaseController.java
...java/com/ruoyi/common/core/controller/BaseController.java
+16
-0
AjaxResult.java
...rc/main/java/com/ruoyi/common/core/domain/AjaxResult.java
+23
-0
GenController.java
...in/java/com/ruoyi/generator/controller/GenController.java
+7
-7
controller.java.vm
...i-generator/src/main/resources/vm/java/controller.java.vm
+2
-2
SysJobController.java
...in/java/com/ruoyi/quartz/controller/SysJobController.java
+1
-1
SysJobLogController.java
...java/com/ruoyi/quartz/controller/SysJobLogController.java
+2
-2
request.js
ruoyi-ui/src/utils/request.js
+6
-0
没有找到文件。
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
浏览文件 @
ebb9f15a
...
...
@@ -64,6 +64,6 @@ public class SysOperlogController extends BaseController
public
AjaxResult
clean
()
{
operLogService
.
cleanOperLog
();
return
AjaxResult
.
success
();
return
success
();
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
浏览文件 @
ebb9f15a
...
...
@@ -87,6 +87,6 @@ public class SysUserOnlineController extends BaseController
public
AjaxResult
forceLogout
(
@PathVariable
String
tokenId
)
{
redisCache
.
deleteObject
(
CacheConstants
.
LOGIN_TOKEN_KEY
+
tokenId
);
return
AjaxResult
.
success
();
return
success
();
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
浏览文件 @
ebb9f15a
...
...
@@ -64,7 +64,7 @@ public class SysConfigController extends BaseController
@GetMapping
(
value
=
"/{configId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
configId
)
{
return
AjaxResult
.
success
(
configService
.
selectConfigById
(
configId
));
return
success
(
configService
.
selectConfigById
(
configId
));
}
/**
...
...
@@ -73,7 +73,7 @@ public class SysConfigController extends BaseController
@GetMapping
(
value
=
"/configKey/{configKey}"
)
public
AjaxResult
getConfigKey
(
@PathVariable
String
configKey
)
{
return
AjaxResult
.
success
(
configService
.
selectConfigByKey
(
configKey
));
return
success
(
configService
.
selectConfigByKey
(
configKey
));
}
/**
...
...
@@ -86,7 +86,7 @@ public class SysConfigController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
configService
.
checkConfigKeyUnique
(
config
)))
{
return
AjaxResult
.
error
(
"新增参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
return
error
(
"新增参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
}
config
.
setCreateBy
(
getUsername
());
return
toAjax
(
configService
.
insertConfig
(
config
));
...
...
@@ -102,7 +102,7 @@ public class SysConfigController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
configService
.
checkConfigKeyUnique
(
config
)))
{
return
AjaxResult
.
error
(
"修改参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
return
error
(
"修改参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
}
config
.
setUpdateBy
(
getUsername
());
return
toAjax
(
configService
.
updateConfig
(
config
));
...
...
@@ -129,6 +129,6 @@ public class SysConfigController extends BaseController
public
AjaxResult
refreshCache
()
{
configService
.
resetConfigCache
();
return
AjaxResult
.
success
();
return
success
();
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
浏览文件 @
ebb9f15a
...
...
@@ -42,7 +42,7 @@ public class SysDeptController extends BaseController
public
AjaxResult
list
(
SysDept
dept
)
{
List
<
SysDept
>
depts
=
deptService
.
selectDeptList
(
dept
);
return
AjaxResult
.
success
(
depts
);
return
success
(
depts
);
}
/**
...
...
@@ -54,7 +54,7 @@ public class SysDeptController extends BaseController
{
List
<
SysDept
>
depts
=
deptService
.
selectDeptList
(
new
SysDept
());
depts
.
removeIf
(
d
->
d
.
getDeptId
().
intValue
()
==
deptId
||
ArrayUtils
.
contains
(
StringUtils
.
split
(
d
.
getAncestors
(),
","
),
deptId
+
""
));
return
AjaxResult
.
success
(
depts
);
return
success
(
depts
);
}
/**
...
...
@@ -65,7 +65,7 @@ public class SysDeptController extends BaseController
public
AjaxResult
getInfo
(
@PathVariable
Long
deptId
)
{
deptService
.
checkDeptDataScope
(
deptId
);
return
AjaxResult
.
success
(
deptService
.
selectDeptById
(
deptId
));
return
success
(
deptService
.
selectDeptById
(
deptId
));
}
/**
...
...
@@ -78,7 +78,7 @@ public class SysDeptController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
deptService
.
checkDeptNameUnique
(
dept
)))
{
return
AjaxResult
.
error
(
"新增部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
return
error
(
"新增部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
}
dept
.
setCreateBy
(
getUsername
());
return
toAjax
(
deptService
.
insertDept
(
dept
));
...
...
@@ -96,15 +96,15 @@ public class SysDeptController extends BaseController
deptService
.
checkDeptDataScope
(
deptId
);
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
deptService
.
checkDeptNameUnique
(
dept
)))
{
return
AjaxResult
.
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
return
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
}
else
if
(
dept
.
getParentId
().
equals
(
deptId
))
{
return
AjaxResult
.
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,上级部门不能是自己"
);
return
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,上级部门不能是自己"
);
}
else
if
(
StringUtils
.
equals
(
UserConstants
.
DEPT_DISABLE
,
dept
.
getStatus
())
&&
deptService
.
selectNormalChildrenDeptById
(
deptId
)
>
0
)
{
return
AjaxResult
.
error
(
"该部门包含未停用的子部门!"
);
return
error
(
"该部门包含未停用的子部门!"
);
}
dept
.
setUpdateBy
(
getUsername
());
return
toAjax
(
deptService
.
updateDept
(
dept
));
...
...
@@ -120,11 +120,11 @@ public class SysDeptController extends BaseController
{
if
(
deptService
.
hasChildByDeptId
(
deptId
))
{
return
AjaxResult
.
error
(
"存在下级部门,不允许删除"
);
return
warn
(
"存在下级部门,不允许删除"
);
}
if
(
deptService
.
checkDeptExistUser
(
deptId
))
{
return
AjaxResult
.
error
(
"部门存在用户,不允许删除"
);
return
warn
(
"部门存在用户,不允许删除"
);
}
deptService
.
checkDeptDataScope
(
deptId
);
return
toAjax
(
deptService
.
deleteDeptById
(
deptId
));
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
浏览文件 @
ebb9f15a
...
...
@@ -66,7 +66,7 @@ public class SysDictDataController extends BaseController
@GetMapping
(
value
=
"/{dictCode}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
dictCode
)
{
return
AjaxResult
.
success
(
dictDataService
.
selectDictDataById
(
dictCode
));
return
success
(
dictDataService
.
selectDictDataById
(
dictCode
));
}
/**
...
...
@@ -80,7 +80,7 @@ public class SysDictDataController extends BaseController
{
data
=
new
ArrayList
<
SysDictData
>();
}
return
AjaxResult
.
success
(
data
);
return
success
(
data
);
}
/**
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
浏览文件 @
ebb9f15a
...
...
@@ -61,7 +61,7 @@ public class SysDictTypeController extends BaseController
@GetMapping
(
value
=
"/{dictId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
dictId
)
{
return
AjaxResult
.
success
(
dictTypeService
.
selectDictTypeById
(
dictId
));
return
success
(
dictTypeService
.
selectDictTypeById
(
dictId
));
}
/**
...
...
@@ -74,7 +74,7 @@ public class SysDictTypeController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
dictTypeService
.
checkDictTypeUnique
(
dict
)))
{
return
AjaxResult
.
error
(
"新增字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
return
error
(
"新增字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
}
dict
.
setCreateBy
(
getUsername
());
return
toAjax
(
dictTypeService
.
insertDictType
(
dict
));
...
...
@@ -90,7 +90,7 @@ public class SysDictTypeController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
dictTypeService
.
checkDictTypeUnique
(
dict
)))
{
return
AjaxResult
.
error
(
"修改字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
return
error
(
"修改字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
}
dict
.
setUpdateBy
(
getUsername
());
return
toAjax
(
dictTypeService
.
updateDictType
(
dict
));
...
...
@@ -117,7 +117,7 @@ public class SysDictTypeController extends BaseController
public
AjaxResult
refreshCache
()
{
dictTypeService
.
resetDictCache
();
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
@@ -127,6 +127,6 @@ public class SysDictTypeController extends BaseController
public
AjaxResult
optionselect
()
{
List
<
SysDictType
>
dictTypes
=
dictTypeService
.
selectDictTypeAll
();
return
AjaxResult
.
success
(
dictTypes
);
return
success
(
dictTypes
);
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
浏览文件 @
ebb9f15a
...
...
@@ -41,7 +41,7 @@ public class SysMenuController extends BaseController
public
AjaxResult
list
(
SysMenu
menu
)
{
List
<
SysMenu
>
menus
=
menuService
.
selectMenuList
(
menu
,
getUserId
());
return
AjaxResult
.
success
(
menus
);
return
success
(
menus
);
}
/**
...
...
@@ -51,7 +51,7 @@ public class SysMenuController extends BaseController
@GetMapping
(
value
=
"/{menuId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
menuId
)
{
return
AjaxResult
.
success
(
menuService
.
selectMenuById
(
menuId
));
return
success
(
menuService
.
selectMenuById
(
menuId
));
}
/**
...
...
@@ -61,7 +61,7 @@ public class SysMenuController extends BaseController
public
AjaxResult
treeselect
(
SysMenu
menu
)
{
List
<
SysMenu
>
menus
=
menuService
.
selectMenuList
(
menu
,
getUserId
());
return
AjaxResult
.
success
(
menuService
.
buildMenuTreeSelect
(
menus
));
return
success
(
menuService
.
buildMenuTreeSelect
(
menus
));
}
/**
...
...
@@ -87,11 +87,11 @@ public class SysMenuController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
menuService
.
checkMenuNameUnique
(
menu
)))
{
return
AjaxResult
.
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
return
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
else
if
(
UserConstants
.
YES_FRAME
.
equals
(
menu
.
getIsFrame
())
&&
!
StringUtils
.
ishttp
(
menu
.
getPath
()))
{
return
AjaxResult
.
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
return
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
}
menu
.
setCreateBy
(
getUsername
());
return
toAjax
(
menuService
.
insertMenu
(
menu
));
...
...
@@ -107,15 +107,15 @@ public class SysMenuController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
menuService
.
checkMenuNameUnique
(
menu
)))
{
return
AjaxResult
.
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
return
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
else
if
(
UserConstants
.
YES_FRAME
.
equals
(
menu
.
getIsFrame
())
&&
!
StringUtils
.
ishttp
(
menu
.
getPath
()))
{
return
AjaxResult
.
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
return
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,地址必须以http(s)://开头"
);
}
else
if
(
menu
.
getMenuId
().
equals
(
menu
.
getParentId
()))
{
return
AjaxResult
.
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,上级菜单不能选择自己"
);
return
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,上级菜单不能选择自己"
);
}
menu
.
setUpdateBy
(
getUsername
());
return
toAjax
(
menuService
.
updateMenu
(
menu
));
...
...
@@ -131,11 +131,11 @@ public class SysMenuController extends BaseController
{
if
(
menuService
.
hasChildByMenuId
(
menuId
))
{
return
AjaxResult
.
error
(
"存在子菜单,不允许删除"
);
return
warn
(
"存在子菜单,不允许删除"
);
}
if
(
menuService
.
checkMenuExistRole
(
menuId
))
{
return
AjaxResult
.
error
(
"菜单已分配,不允许删除"
);
return
warn
(
"菜单已分配,不允许删除"
);
}
return
toAjax
(
menuService
.
deleteMenuById
(
menuId
));
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
浏览文件 @
ebb9f15a
...
...
@@ -51,7 +51,7 @@ public class SysNoticeController extends BaseController
@GetMapping
(
value
=
"/{noticeId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
noticeId
)
{
return
AjaxResult
.
success
(
noticeService
.
selectNoticeById
(
noticeId
));
return
success
(
noticeService
.
selectNoticeById
(
noticeId
));
}
/**
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
浏览文件 @
ebb9f15a
...
...
@@ -64,7 +64,7 @@ public class SysPostController extends BaseController
@GetMapping
(
value
=
"/{postId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
postId
)
{
return
AjaxResult
.
success
(
postService
.
selectPostById
(
postId
));
return
success
(
postService
.
selectPostById
(
postId
));
}
/**
...
...
@@ -77,11 +77,11 @@ public class SysPostController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostNameUnique
(
post
)))
{
return
AjaxResult
.
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostCodeUnique
(
post
)))
{
return
AjaxResult
.
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
}
post
.
setCreateBy
(
getUsername
());
return
toAjax
(
postService
.
insertPost
(
post
));
...
...
@@ -97,11 +97,11 @@ public class SysPostController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostNameUnique
(
post
)))
{
return
AjaxResult
.
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostCodeUnique
(
post
)))
{
return
AjaxResult
.
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
}
post
.
setUpdateBy
(
getUsername
());
return
toAjax
(
postService
.
updatePost
(
post
));
...
...
@@ -125,6 +125,6 @@ public class SysPostController extends BaseController
public
AjaxResult
optionselect
()
{
List
<
SysPost
>
posts
=
postService
.
selectPostAll
();
return
AjaxResult
.
success
(
posts
);
return
success
(
posts
);
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
浏览文件 @
ebb9f15a
...
...
@@ -66,12 +66,12 @@ public class SysProfileController extends BaseController
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
return
AjaxResult
.
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
return
AjaxResult
.
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
user
.
setUserId
(
sysUser
.
getUserId
());
user
.
setPassword
(
null
);
...
...
@@ -85,9 +85,9 @@ public class SysProfileController extends BaseController
sysUser
.
setEmail
(
user
.
getEmail
());
sysUser
.
setSex
(
user
.
getSex
());
tokenService
.
setLoginUser
(
loginUser
);
return
AjaxResult
.
success
();
return
success
();
}
return
AjaxResult
.
error
(
"修改个人信息异常,请联系管理员"
);
return
error
(
"修改个人信息异常,请联系管理员"
);
}
/**
...
...
@@ -102,20 +102,20 @@ public class SysProfileController extends BaseController
String
password
=
loginUser
.
getPassword
();
if
(!
SecurityUtils
.
matchesPassword
(
oldPassword
,
password
))
{
return
AjaxResult
.
error
(
"修改密码失败,旧密码错误"
);
return
error
(
"修改密码失败,旧密码错误"
);
}
if
(
SecurityUtils
.
matchesPassword
(
newPassword
,
password
))
{
return
AjaxResult
.
error
(
"新密码不能与旧密码相同"
);
return
error
(
"新密码不能与旧密码相同"
);
}
if
(
userService
.
resetUserPwd
(
userName
,
SecurityUtils
.
encryptPassword
(
newPassword
))
>
0
)
{
// 更新缓存用户密码
loginUser
.
getUser
().
setPassword
(
SecurityUtils
.
encryptPassword
(
newPassword
));
tokenService
.
setLoginUser
(
loginUser
);
return
AjaxResult
.
success
();
return
success
();
}
return
AjaxResult
.
error
(
"修改密码异常,请联系管理员"
);
return
error
(
"修改密码异常,请联系管理员"
);
}
/**
...
...
@@ -139,6 +139,6 @@ public class SysProfileController extends BaseController
return
ajax
;
}
}
return
AjaxResult
.
error
(
"上传图片异常,请联系管理员"
);
return
error
(
"上传图片异常,请联系管理员"
);
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
浏览文件 @
ebb9f15a
...
...
@@ -83,7 +83,7 @@ public class SysRoleController extends BaseController
public
AjaxResult
getInfo
(
@PathVariable
Long
roleId
)
{
roleService
.
checkRoleDataScope
(
roleId
);
return
AjaxResult
.
success
(
roleService
.
selectRoleById
(
roleId
));
return
success
(
roleService
.
selectRoleById
(
roleId
));
}
/**
...
...
@@ -96,11 +96,11 @@ public class SysRoleController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleNameUnique
(
role
)))
{
return
AjaxResult
.
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleKeyUnique
(
role
)))
{
return
AjaxResult
.
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
}
role
.
setCreateBy
(
getUsername
());
return
toAjax
(
roleService
.
insertRole
(
role
));
...
...
@@ -119,11 +119,11 @@ public class SysRoleController extends BaseController
roleService
.
checkRoleDataScope
(
role
.
getRoleId
());
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleNameUnique
(
role
)))
{
return
AjaxResult
.
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleKeyUnique
(
role
)))
{
return
AjaxResult
.
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
}
role
.
setUpdateBy
(
getUsername
());
...
...
@@ -137,9 +137,9 @@ public class SysRoleController extends BaseController
loginUser
.
setUser
(
userService
.
selectUserByUserName
(
loginUser
.
getUser
().
getUserName
()));
tokenService
.
setLoginUser
(
loginUser
);
}
return
AjaxResult
.
success
();
return
success
();
}
return
AjaxResult
.
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,请联系管理员"
);
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,请联系管理员"
);
}
/**
...
...
@@ -187,7 +187,7 @@ public class SysRoleController extends BaseController
@GetMapping
(
"/optionselect"
)
public
AjaxResult
optionselect
()
{
return
AjaxResult
.
success
(
roleService
.
selectRoleAll
());
return
success
(
roleService
.
selectRoleAll
());
}
/**
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
浏览文件 @
ebb9f15a
...
...
@@ -85,7 +85,7 @@ public class SysUserController extends BaseController
List
<
SysUser
>
userList
=
util
.
importExcel
(
file
.
getInputStream
());
String
operName
=
getUsername
();
String
message
=
userService
.
importUser
(
userList
,
updateSupport
,
operName
);
return
AjaxResult
.
success
(
message
);
return
success
(
message
);
}
@PostMapping
(
"/importTemplate"
)
...
...
@@ -127,17 +127,17 @@ public class SysUserController extends BaseController
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkUserNameUnique
(
user
)))
{
return
AjaxResult
.
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
return
AjaxResult
.
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
return
AjaxResult
.
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
user
.
setCreateBy
(
getUsername
());
user
.
setPassword
(
SecurityUtils
.
encryptPassword
(
user
.
getPassword
()));
...
...
@@ -156,17 +156,17 @@ public class SysUserController extends BaseController
userService
.
checkUserDataScope
(
user
.
getUserId
());
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkUserNameUnique
(
user
)))
{
return
AjaxResult
.
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
return
AjaxResult
.
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
return
AjaxResult
.
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
user
.
setUpdateBy
(
getUsername
());
return
toAjax
(
userService
.
updateUser
(
user
));
...
...
@@ -251,6 +251,6 @@ public class SysUserController extends BaseController
@GetMapping
(
"/deptTree"
)
public
AjaxResult
deptTree
(
SysDept
dept
)
{
return
AjaxResult
.
success
(
deptService
.
selectDeptTreeList
(
dept
));
return
success
(
deptService
.
selectDeptTreeList
(
dept
));
}
}
ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java
浏览文件 @
ebb9f15a
...
...
@@ -86,4 +86,9 @@ public class HttpStatus
* 接口未实现
*/
public
static
final
int
NOT_IMPLEMENTED
=
501
;
/**
* 系统警告消息
*/
public
static
final
int
WARN
=
601
;
}
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
浏览文件 @
ebb9f15a
...
...
@@ -113,6 +113,14 @@ public class BaseController
{
return
AjaxResult
.
success
(
message
);
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
Object
data
)
{
return
AjaxResult
.
success
(
data
);
}
/**
* 返回失败消息
...
...
@@ -122,6 +130,14 @@ public class BaseController
return
AjaxResult
.
error
(
message
);
}
/**
* 返回警告消息
*/
public
AjaxResult
warn
(
String
message
)
{
return
AjaxResult
.
warn
(
message
);
}
/**
* 响应返回结果
*
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
浏览文件 @
ebb9f15a
...
...
@@ -101,6 +101,29 @@ public class AjaxResult extends HashMap<String, Object>
return
new
AjaxResult
(
HttpStatus
.
SUCCESS
,
msg
,
data
);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @return 警告消息
*/
public
static
AjaxResult
warn
(
String
msg
)
{
return
AjaxResult
.
warn
(
msg
,
null
);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public
static
AjaxResult
warn
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
WARN
,
msg
,
data
);
}
/**
* 返回错误消息
*
...
...
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
浏览文件 @
ebb9f15a
...
...
@@ -69,7 +69,7 @@ public class GenController extends BaseController
map
.
put
(
"info"
,
table
);
map
.
put
(
"rows"
,
list
);
map
.
put
(
"tables"
,
tables
);
return
AjaxResult
.
success
(
map
);
return
success
(
map
);
}
/**
...
...
@@ -110,7 +110,7 @@ public class GenController extends BaseController
// 查询表信息
List
<
GenTable
>
tableList
=
genTableService
.
selectDbTableListByNames
(
tableNames
);
genTableService
.
importGenTable
(
tableList
);
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
@@ -123,7 +123,7 @@ public class GenController extends BaseController
{
genTableService
.
validateEdit
(
genTable
);
genTableService
.
updateGenTable
(
genTable
);
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
@@ -135,7 +135,7 @@ public class GenController extends BaseController
public
AjaxResult
remove
(
@PathVariable
Long
[]
tableIds
)
{
genTableService
.
deleteGenTableByIds
(
tableIds
);
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
@@ -146,7 +146,7 @@ public class GenController extends BaseController
public
AjaxResult
preview
(
@PathVariable
(
"tableId"
)
Long
tableId
)
throws
IOException
{
Map
<
String
,
String
>
dataMap
=
genTableService
.
previewCode
(
tableId
);
return
AjaxResult
.
success
(
dataMap
);
return
success
(
dataMap
);
}
/**
...
...
@@ -170,7 +170,7 @@ public class GenController extends BaseController
public
AjaxResult
genCode
(
@PathVariable
(
"tableName"
)
String
tableName
)
{
genTableService
.
generatorCode
(
tableName
);
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
@@ -182,7 +182,7 @@ public class GenController extends BaseController
public
AjaxResult
synchDb
(
@PathVariable
(
"tableName"
)
String
tableName
)
{
genTableService
.
synchDb
(
tableName
);
return
AjaxResult
.
success
();
return
success
();
}
/**
...
...
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
浏览文件 @
ebb9f15a
...
...
@@ -53,7 +53,7 @@ public class ${ClassName}Controller extends BaseController
public
AjaxResult
list
(${
ClassName
}
${
className
})
{
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
return
AjaxResult
.
success
(
list
);
return
success
(
list
);
}
#
end
...
...
@@ -77,7 +77,7 @@ public class ${ClassName}Controller extends BaseController
@
GetMapping
(
value
=
"/{${pkColumn.javaField}}"
)
public
AjaxResult
getInfo
(@
PathVariable
(
"${pkColumn.javaField}"
)
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
{
return
AjaxResult
.
success
(${
className
}
Service
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
}));
return
success
(${
className
}
Service
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
}));
}
/**
...
...
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
浏览文件 @
ebb9f15a
...
...
@@ -71,7 +71,7 @@ public class SysJobController extends BaseController
@GetMapping
(
value
=
"/{jobId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"jobId"
)
Long
jobId
)
{
return
AjaxResult
.
success
(
jobService
.
selectJobById
(
jobId
));
return
success
(
jobService
.
selectJobById
(
jobId
));
}
/**
...
...
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java
浏览文件 @
ebb9f15a
...
...
@@ -63,7 +63,7 @@ public class SysJobLogController extends BaseController
@GetMapping
(
value
=
"/{configId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Long
jobLogId
)
{
return
AjaxResult
.
success
(
jobLogService
.
selectJobLogById
(
jobLogId
));
return
success
(
jobLogService
.
selectJobLogById
(
jobLogId
));
}
...
...
@@ -87,6 +87,6 @@ public class SysJobLogController extends BaseController
public
AjaxResult
clean
()
{
jobLogService
.
cleanJobLog
();
return
AjaxResult
.
success
();
return
success
();
}
}
ruoyi-ui/src/utils/request.js
浏览文件 @
ebb9f15a
...
...
@@ -99,6 +99,12 @@ service.interceptors.response.use(res => {
type
:
'error'
})
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
===
601
)
{
Message
({
message
:
msg
,
type
:
'warning'
})
return
Promise
.
reject
(
'error'
)
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
msg
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论