更新ruoyi -ue至最新版本-20220908
This commit is contained in:
parent
50e12c5d7c
commit
e5c5bcd8f8
6
pom.xml
6
pom.xml
@ -23,9 +23,9 @@
|
|||||||
<swagger.version>3.0.0</swagger.version>
|
<swagger.version>3.0.0</swagger.version>
|
||||||
<kaptcha.version>2.3.2</kaptcha.version>
|
<kaptcha.version>2.3.2</kaptcha.version>
|
||||||
<mybatis-spring-boot.version>2.2.2</mybatis-spring-boot.version>
|
<mybatis-spring-boot.version>2.2.2</mybatis-spring-boot.version>
|
||||||
<pagehelper.boot.version>1.4.1</pagehelper.boot.version>
|
<pagehelper.boot.version>1.4.3</pagehelper.boot.version>
|
||||||
<fastjson.version>2.0.8</fastjson.version>
|
<fastjson.version>2.0.12</fastjson.version>
|
||||||
<oshi.version>6.1.6</oshi.version>
|
<oshi.version>6.2.2</oshi.version>
|
||||||
<commons.io.version>2.11.0</commons.io.version>
|
<commons.io.version>2.11.0</commons.io.version>
|
||||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||||
<commons.collections.version>3.2.2</commons.collections.version>
|
<commons.collections.version>3.2.2</commons.collections.version>
|
||||||
|
@ -46,9 +46,9 @@ public class CaptchaController
|
|||||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||||
{
|
{
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||||
ajax.put("captchaOnOff", captchaOnOff);
|
ajax.put("captchaEnabled", captchaEnabled);
|
||||||
if (!captchaOnOff)
|
if (!captchaEnabled)
|
||||||
{
|
{
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class CacheController
|
|||||||
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||||
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||||
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||||
|
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
@ -78,8 +79,8 @@ public class CacheController
|
|||||||
@GetMapping("/getKeys/{cacheName}")
|
@GetMapping("/getKeys/{cacheName}")
|
||||||
public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
||||||
{
|
{
|
||||||
Set<String> cacheKyes = redisTemplate.keys(cacheName + "*");
|
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||||
return AjaxResult.success(cacheKyes);
|
return AjaxResult.success(cacheKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@ -16,6 +16,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.service.SysPasswordService;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
|
|
||||||
@ -31,6 +32,9 @@ public class SysLogininforController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysLogininforService logininforService;
|
private ISysLogininforService logininforService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysLogininfor logininfor)
|
public TableDataInfo list(SysLogininfor logininfor)
|
||||||
@ -64,6 +68,15 @@ public class SysLogininforController extends BaseController
|
|||||||
public AjaxResult clean()
|
public AjaxResult clean()
|
||||||
{
|
{
|
||||||
logininforService.cleanLogininfor();
|
logininforService.cleanLogininfor();
|
||||||
return AjaxResult.success();
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
||||||
|
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||||
|
@GetMapping("/unlock/{userName}")
|
||||||
|
public AjaxResult unlock(@PathVariable("userName") String userName)
|
||||||
|
{
|
||||||
|
passwordService.clearLoginRecordCache(userName);
|
||||||
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -54,16 +53,7 @@ public class SysDeptController extends BaseController
|
|||||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||||
{
|
{
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
Iterator<SysDept> it = depts.iterator();
|
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
SysDept d = (SysDept) it.next();
|
|
||||||
if (d.getDeptId().intValue() == deptId
|
|
||||||
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
|
|
||||||
{
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return AjaxResult.success(depts);
|
return AjaxResult.success(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,29 +68,6 @@ public class SysDeptController extends BaseController
|
|||||||
return AjaxResult.success(deptService.selectDeptById(deptId));
|
return AjaxResult.success(deptService.selectDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取部门下拉树列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/treeselect")
|
|
||||||
public AjaxResult treeselect(SysDept dept)
|
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
|
||||||
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加载对应角色部门列表树
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
|
||||||
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
|
||||||
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
|
|
||||||
return ajax;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门
|
* 新增部门
|
||||||
*/
|
*/
|
||||||
|
@ -75,6 +75,8 @@ public class SysProfileController extends BaseController
|
|||||||
}
|
}
|
||||||
user.setUserId(sysUser.getUserId());
|
user.setUserId(sysUser.getUserId());
|
||||||
user.setPassword(null);
|
user.setPassword(null);
|
||||||
|
user.setAvatar(null);
|
||||||
|
user.setDeptId(null);
|
||||||
if (userService.updateUserProfile(user) > 0)
|
if (userService.updateUserProfile(user) > 0)
|
||||||
{
|
{
|
||||||
// 更新缓存用户信息
|
// 更新缓存用户信息
|
||||||
|
@ -17,6 +17,7 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
@ -27,6 +28,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
import com.ruoyi.framework.web.service.TokenService;
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
|
||||||
@ -44,13 +46,16 @@ public class SysRoleController extends BaseController
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysRole role)
|
public TableDataInfo list(SysRole role)
|
||||||
@ -242,4 +247,17 @@ public class SysRoleController extends BaseController
|
|||||||
roleService.checkRoleDataScope(roleId);
|
roleService.checkRoleDataScope(roleId);
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应角色部门树列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
@GetMapping(value = "/deptTree/{roleId}")
|
||||||
|
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
|
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
@ -27,6 +28,7 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
@ -46,6 +48,9 @@ public class SysUserController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
|
||||||
@ -234,4 +239,14 @@ public class SysUserController extends BaseController
|
|||||||
userService.insertUserAuth(userId, roleIds);
|
userService.insertUserAuth(userId, roleIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门树列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||||
|
@GetMapping("/deptTree")
|
||||||
|
public AjaxResult deptTree(SysDept dept)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(deptService.selectDeptTreeList(dept));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://10.100.0.114:3306/nocode?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://10.100.0.114:3306/mycode?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: root
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
|
@ -39,6 +39,14 @@ logging:
|
|||||||
com.ruoyi: debug
|
com.ruoyi: debug
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
|
|
||||||
|
# 用户配置
|
||||||
|
user:
|
||||||
|
password:
|
||||||
|
# 密码最大错误次数
|
||||||
|
maxRetryCount: 5
|
||||||
|
# 密码锁定时间(默认10分钟)
|
||||||
|
lockTime: 10
|
||||||
|
|
||||||
# Spring配置
|
# Spring配置
|
||||||
spring:
|
spring:
|
||||||
# 资源信息
|
# 资源信息
|
||||||
@ -87,7 +95,7 @@ spring:
|
|||||||
port: 27017
|
port: 27017
|
||||||
username: admin
|
username: admin
|
||||||
password: admin
|
password: admin
|
||||||
database: nocode
|
database: mycode
|
||||||
authentication-database: admin
|
authentication-database: admin
|
||||||
activiti:
|
activiti:
|
||||||
check-process-definitions: false
|
check-process-definitions: false
|
||||||
|
@ -5,7 +5,7 @@ user.jcaptcha.expire=验证码已失效
|
|||||||
user.not.exists=用户不存在/密码错误
|
user.not.exists=用户不存在/密码错误
|
||||||
user.password.not.match=用户不存在/密码错误
|
user.password.not.match=用户不存在/密码错误
|
||||||
user.password.retry.limit.count=密码输入错误{0}次
|
user.password.retry.limit.count=密码输入错误{0}次
|
||||||
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
|
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
|
||||||
user.password.delete=对不起,您的账号已被删除
|
user.password.delete=对不起,您的账号已被删除
|
||||||
user.blocked=用户已封禁,请联系管理员
|
user.blocked=用户已封禁,请联系管理员
|
||||||
role.blocked=角色已封禁,请联系管理员
|
role.blocked=角色已封禁,请联系管理员
|
||||||
|
@ -25,4 +25,9 @@ public @interface DataScope
|
|||||||
* 用户表的别名
|
* 用户表的别名
|
||||||
*/
|
*/
|
||||||
public String userAlias() default "";
|
public String userAlias() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来
|
||||||
|
*/
|
||||||
|
public String permission() default "";
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,11 @@ public @interface Excel
|
|||||||
*/
|
*/
|
||||||
public String[] combo() default {};
|
public String[] combo() default {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
||||||
|
*/
|
||||||
|
public boolean needMerge() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||||
*/
|
*/
|
||||||
@ -104,12 +109,27 @@ public @interface Excel
|
|||||||
public boolean isStatistics() default false;
|
public boolean isStatistics() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出类型(0数字 1字符串)
|
* 导出类型(0数字 1字符串 2图片)
|
||||||
*/
|
*/
|
||||||
public ColumnType cellType() default ColumnType.STRING;
|
public ColumnType cellType() default ColumnType.STRING;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出字体颜色
|
* 导出列头背景色
|
||||||
|
*/
|
||||||
|
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出列头字体颜色
|
||||||
|
*/
|
||||||
|
public IndexedColors headerColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出单元格背景色
|
||||||
|
*/
|
||||||
|
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出单元格字体颜色
|
||||||
*/
|
*/
|
||||||
public IndexedColors color() default IndexedColors.BLACK;
|
public IndexedColors color() default IndexedColors.BLACK;
|
||||||
|
|
||||||
@ -128,22 +148,6 @@ public @interface Excel
|
|||||||
*/
|
*/
|
||||||
public String[] args() default {};
|
public String[] args() default {};
|
||||||
|
|
||||||
public enum Align
|
|
||||||
{
|
|
||||||
AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
Align(int value)
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int value()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||||
*/
|
*/
|
||||||
|
@ -36,4 +36,9 @@ public class CacheConstants
|
|||||||
* 限流 redis key
|
* 限流 redis key
|
||||||
*/
|
*/
|
||||||
public static final String RATE_LIMIT_KEY = "rate_limit:";
|
public static final String RATE_LIMIT_KEY = "rate_limit:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账户密码错误次数 redis key
|
||||||
|
*/
|
||||||
|
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,11 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String GBK = "GBK";
|
public static final String GBK = "GBK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* www主域
|
||||||
|
*/
|
||||||
|
public static final String WWW = "www.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http请求
|
* http请求
|
||||||
*/
|
*/
|
||||||
|
@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
|
|||||||
|
|
||||||
public boolean getDefault()
|
public boolean getDefault()
|
||||||
{
|
{
|
||||||
return UserConstants.YES.equals(this.isDefault) ? true : false;
|
return UserConstants.YES.equals(this.isDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsDefault()
|
public String getIsDefault()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
@ -59,6 +60,9 @@ public class SysRole extends BaseEntity
|
|||||||
/** 部门组(数据权限) */
|
/** 部门组(数据权限) */
|
||||||
private Long[] deptIds;
|
private Long[] deptIds;
|
||||||
|
|
||||||
|
/** 角色菜单权限 */
|
||||||
|
private Set<String> permissions;
|
||||||
|
|
||||||
public SysRole()
|
public SysRole()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -203,7 +207,17 @@ public class SysRole extends BaseEntity
|
|||||||
{
|
{
|
||||||
this.deptIds = deptIds;
|
this.deptIds = deptIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getPermissions()
|
||||||
|
{
|
||||||
|
return permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(Set<String> permissions)
|
||||||
|
{
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
@ -74,6 +74,28 @@ public class RedisCache
|
|||||||
return redisTemplate.expire(key, timeout, unit);
|
return redisTemplate.expire(key, timeout, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取有效时间
|
||||||
|
*
|
||||||
|
* @param key Redis键
|
||||||
|
* @return 有效时间
|
||||||
|
*/
|
||||||
|
public long getExpire(final String key)
|
||||||
|
{
|
||||||
|
return redisTemplate.getExpire(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断 key是否存在
|
||||||
|
*
|
||||||
|
* @param key 键
|
||||||
|
* @return true 存在 false不存在
|
||||||
|
*/
|
||||||
|
public Boolean hasKey(String key)
|
||||||
|
{
|
||||||
|
return redisTemplate.hasKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得缓存的基本对象。
|
* 获得缓存的基本对象。
|
||||||
*
|
*
|
||||||
@ -102,9 +124,9 @@ public class RedisCache
|
|||||||
* @param collection 多个对象
|
* @param collection 多个对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public long deleteObject(final Collection collection)
|
public boolean deleteObject(final Collection collection)
|
||||||
{
|
{
|
||||||
return redisTemplate.delete(collection);
|
return redisTemplate.delete(collection) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,18 +231,6 @@ public class RedisCache
|
|||||||
return opsForHash.get(key, hKey);
|
return opsForHash.get(key, hKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除Hash中的数据
|
|
||||||
*
|
|
||||||
* @param key
|
|
||||||
* @param hKey
|
|
||||||
*/
|
|
||||||
public void delCacheMapValue(final String key, final String hKey)
|
|
||||||
{
|
|
||||||
HashOperations hashOperations = redisTemplate.opsForHash();
|
|
||||||
hashOperations.delete(key, hKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取多个Hash中的数据
|
* 获取多个Hash中的数据
|
||||||
*
|
*
|
||||||
@ -233,6 +243,18 @@ public class RedisCache
|
|||||||
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除Hash中的某条数据
|
||||||
|
*
|
||||||
|
* @param key Redis键
|
||||||
|
* @param hKey Hash键
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
public boolean deleteCacheMapValue(final String key, final String hKey)
|
||||||
|
{
|
||||||
|
return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得缓存的基本对象列表
|
* 获得缓存的基本对象列表
|
||||||
*
|
*
|
||||||
|
@ -894,7 +894,7 @@ public class Convert
|
|||||||
*/
|
*/
|
||||||
public static String toSBC(String input, Set<Character> notConvertSet)
|
public static String toSBC(String input, Set<Character> notConvertSet)
|
||||||
{
|
{
|
||||||
char c[] = input.toCharArray();
|
char[] c = input.toCharArray();
|
||||||
for (int i = 0; i < c.length; i++)
|
for (int i = 0; i < c.length; i++)
|
||||||
{
|
{
|
||||||
if (null != notConvertSet && notConvertSet.contains(c[i]))
|
if (null != notConvertSet && notConvertSet.contains(c[i]))
|
||||||
@ -936,7 +936,7 @@ public class Convert
|
|||||||
*/
|
*/
|
||||||
public static String toDBC(String text, Set<Character> notConvertSet)
|
public static String toDBC(String text, Set<Character> notConvertSet)
|
||||||
{
|
{
|
||||||
char c[] = text.toCharArray();
|
char[] c = text.toCharArray();
|
||||||
for (int i = 0; i < c.length; i++)
|
for (int i = 0; i < c.length; i++)
|
||||||
{
|
{
|
||||||
if (null != notConvertSet && notConvertSet.contains(c[i]))
|
if (null != notConvertSet && notConvertSet.contains(c[i]))
|
||||||
|
@ -7,7 +7,6 @@ package com.ruoyi.common.exception;
|
|||||||
*/
|
*/
|
||||||
public class GlobalException extends RuntimeException
|
public class GlobalException extends RuntimeException
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +44,7 @@ public class GlobalException extends RuntimeException
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getMessage()
|
public String getMessage()
|
||||||
{
|
{
|
||||||
return message;
|
return message;
|
||||||
|
@ -49,6 +49,7 @@ public final class ServiceException extends RuntimeException
|
|||||||
return detailMessage;
|
return detailMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getMessage()
|
public String getMessage()
|
||||||
{
|
{
|
||||||
return message;
|
return message;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户错误最大次数异常类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class UserPasswordRetryLimitExceedException extends UserException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime)
|
||||||
|
{
|
||||||
|
super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime });
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.common.filter;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.filter.SimplePropertyPreFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排除JSON敏感属性
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class PropertyPreExcludeFilter extends SimplePropertyPreFilter
|
||||||
|
{
|
||||||
|
public PropertyPreExcludeFilter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyPreExcludeFilter addExcludes(String... filters)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < filters.length; i++)
|
||||||
|
{
|
||||||
|
this.getExcludes().add(filters[i]);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ import javax.servlet.ServletResponse;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
import com.ruoyi.common.utils.http.HttpHelper;
|
import com.ruoyi.common.utils.http.HttpHelper;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建可重复读取inputStream的request
|
* 构建可重复读取inputStream的request
|
||||||
@ -23,10 +24,10 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
|
|||||||
public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException
|
public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException
|
||||||
{
|
{
|
||||||
super(request);
|
super(request);
|
||||||
request.setCharacterEncoding("UTF-8");
|
request.setCharacterEncoding(Constants.UTF8);
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding(Constants.UTF8);
|
||||||
|
|
||||||
body = HttpHelper.getBodyString(request).getBytes("UTF-8");
|
body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -12,6 +12,7 @@ import javax.servlet.ServletResponse;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.enums.HttpMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防止XSS攻击的过滤器
|
* 防止XSS攻击的过滤器
|
||||||
@ -59,7 +60,7 @@ public class XssFilter implements Filter
|
|||||||
String url = request.getServletPath();
|
String url = request.getServletPath();
|
||||||
String method = request.getMethod();
|
String method = request.getMethod();
|
||||||
// GET DELETE 不过滤
|
// GET DELETE 不过滤
|
||||||
if (method == null || method.matches("GET") || method.matches("DELETE"))
|
if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -324,6 +324,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
|
||||||
|
*
|
||||||
|
* @param set 给定的集合
|
||||||
|
* @param array 给定的数组
|
||||||
|
* @return boolean 结果
|
||||||
|
*/
|
||||||
|
public static boolean containsAny(Collection<String> collection, String... array)
|
||||||
|
{
|
||||||
|
if (isEmpty(collection) || isEmpty(array))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (String str : array)
|
||||||
|
{
|
||||||
|
if (collection.contains(str))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
|
* 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
|
||||||
*
|
*
|
||||||
|
@ -387,7 +387,7 @@ public final class HTMLFilter
|
|||||||
{
|
{
|
||||||
paramValue = processParamProtocol(paramValue);
|
paramValue = processParamProtocol(paramValue);
|
||||||
}
|
}
|
||||||
params.append(' ').append(paramName).append("=\\\"").append(paramValue).append("\"");
|
params.append(' ').append(paramName).append("=\\\"").append(paramValue).append("\\\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,12 +7,14 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -22,7 +24,9 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.RegExUtils;
|
import org.apache.commons.lang3.RegExUtils;
|
||||||
|
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFPicture;
|
import org.apache.poi.hssf.usermodel.HSSFPicture;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFPictureData;
|
import org.apache.poi.hssf.usermodel.HSSFPictureData;
|
||||||
@ -148,6 +152,26 @@ public class ExcelUtil<T>
|
|||||||
*/
|
*/
|
||||||
private short maxHeight;
|
private short maxHeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合并后最后行数
|
||||||
|
*/
|
||||||
|
private int subMergedLastRowNum = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合并后开始行数
|
||||||
|
*/
|
||||||
|
private int subMergedFirstRowNum = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象的子列表方法
|
||||||
|
*/
|
||||||
|
private Method subMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象的子列表属性
|
||||||
|
*/
|
||||||
|
private List<Field> subFields;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计列表
|
* 统计列表
|
||||||
*/
|
*/
|
||||||
@ -163,11 +187,27 @@ public class ExcelUtil<T>
|
|||||||
*/
|
*/
|
||||||
public Class<T> clazz;
|
public Class<T> clazz;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需要排除列属性
|
||||||
|
*/
|
||||||
|
public String[] excludeFields;
|
||||||
|
|
||||||
public ExcelUtil(Class<T> clazz)
|
public ExcelUtil(Class<T> clazz)
|
||||||
{
|
{
|
||||||
this.clazz = clazz;
|
this.clazz = clazz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 隐藏Excel中列属性
|
||||||
|
*
|
||||||
|
* @param fields 列属性名 示例[单个"name"/多个"id","name"]
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void hideColumn(String... fields)
|
||||||
|
{
|
||||||
|
this.excludeFields = fields;
|
||||||
|
}
|
||||||
|
|
||||||
public void init(List<T> list, String sheetName, String title, Type type)
|
public void init(List<T> list, String sheetName, String title, Type type)
|
||||||
{
|
{
|
||||||
if (list == null)
|
if (list == null)
|
||||||
@ -181,6 +221,7 @@ public class ExcelUtil<T>
|
|||||||
createExcelField();
|
createExcelField();
|
||||||
createWorkbook();
|
createWorkbook();
|
||||||
createTitle();
|
createTitle();
|
||||||
|
createSubHead();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -190,13 +231,48 @@ public class ExcelUtil<T>
|
|||||||
{
|
{
|
||||||
if (StringUtils.isNotEmpty(title))
|
if (StringUtils.isNotEmpty(title))
|
||||||
{
|
{
|
||||||
|
subMergedFirstRowNum++;
|
||||||
|
subMergedLastRowNum++;
|
||||||
|
int titleLastCol = this.fields.size() - 1;
|
||||||
|
if (isSubList())
|
||||||
|
{
|
||||||
|
titleLastCol = titleLastCol + subFields.size() - 1;
|
||||||
|
}
|
||||||
Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0);
|
Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0);
|
||||||
titleRow.setHeightInPoints(30);
|
titleRow.setHeightInPoints(30);
|
||||||
Cell titleCell = titleRow.createCell(0);
|
Cell titleCell = titleRow.createCell(0);
|
||||||
titleCell.setCellStyle(styles.get("title"));
|
titleCell.setCellStyle(styles.get("title"));
|
||||||
titleCell.setCellValue(title);
|
titleCell.setCellValue(title);
|
||||||
sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(),
|
sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(), titleLastCol));
|
||||||
this.fields.size() - 1));
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建对象的子列表名称
|
||||||
|
*/
|
||||||
|
public void createSubHead()
|
||||||
|
{
|
||||||
|
if (isSubList())
|
||||||
|
{
|
||||||
|
subMergedFirstRowNum++;
|
||||||
|
subMergedLastRowNum++;
|
||||||
|
Row subRow = sheet.createRow(rownum);
|
||||||
|
int excelNum = 0;
|
||||||
|
for (Object[] objects : fields)
|
||||||
|
{
|
||||||
|
Excel attr = (Excel) objects[1];
|
||||||
|
Cell headCell1 = subRow.createCell(excelNum);
|
||||||
|
headCell1.setCellValue(attr.name());
|
||||||
|
headCell1.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
|
||||||
|
excelNum++;
|
||||||
|
}
|
||||||
|
int headFirstRow = excelNum - 1;
|
||||||
|
int headLastRow = headFirstRow + subFields.size() - 1;
|
||||||
|
if (headLastRow > headFirstRow)
|
||||||
|
{
|
||||||
|
sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, headFirstRow, headLastRow));
|
||||||
|
}
|
||||||
|
rownum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,8 +652,20 @@ public class ExcelUtil<T>
|
|||||||
// 写入各个字段的列头名称
|
// 写入各个字段的列头名称
|
||||||
for (Object[] os : fields)
|
for (Object[] os : fields)
|
||||||
{
|
{
|
||||||
|
Field field = (Field) os[0];
|
||||||
Excel excel = (Excel) os[1];
|
Excel excel = (Excel) os[1];
|
||||||
this.createCell(excel, row, column++);
|
if (Collection.class.isAssignableFrom(field.getType()))
|
||||||
|
{
|
||||||
|
for (Field subField : subFields)
|
||||||
|
{
|
||||||
|
Excel subExcel = subField.getAnnotation(Excel.class);
|
||||||
|
this.createHeadCell(subExcel, row, column++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.createHeadCell(excel, row, column++);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Type.EXPORT.equals(type))
|
if (Type.EXPORT.equals(type))
|
||||||
{
|
{
|
||||||
@ -593,21 +681,60 @@ public class ExcelUtil<T>
|
|||||||
* @param index 序号
|
* @param index 序号
|
||||||
* @param row 单元格行
|
* @param row 单元格行
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void fillExcelData(int index, Row row)
|
public void fillExcelData(int index, Row row)
|
||||||
{
|
{
|
||||||
int startNo = index * sheetSize;
|
int startNo = index * sheetSize;
|
||||||
int endNo = Math.min(startNo + sheetSize, list.size());
|
int endNo = Math.min(startNo + sheetSize, list.size());
|
||||||
|
int rowNo = (1 + rownum) - startNo;
|
||||||
for (int i = startNo; i < endNo; i++)
|
for (int i = startNo; i < endNo; i++)
|
||||||
{
|
{
|
||||||
row = sheet.createRow(i + 1 + rownum - startNo);
|
rowNo = i > 1 ? rowNo + 1 : rowNo + i;
|
||||||
|
row = sheet.createRow(rowNo);
|
||||||
// 得到导出对象.
|
// 得到导出对象.
|
||||||
T vo = (T) list.get(i);
|
T vo = (T) list.get(i);
|
||||||
|
Collection<?> subList = null;
|
||||||
|
if (isSubListValue(vo))
|
||||||
|
{
|
||||||
|
subList = getListCellValue(vo);
|
||||||
|
subMergedLastRowNum = subMergedLastRowNum + subList.size();
|
||||||
|
}
|
||||||
|
|
||||||
int column = 0;
|
int column = 0;
|
||||||
for (Object[] os : fields)
|
for (Object[] os : fields)
|
||||||
{
|
{
|
||||||
Field field = (Field) os[0];
|
Field field = (Field) os[0];
|
||||||
Excel excel = (Excel) os[1];
|
Excel excel = (Excel) os[1];
|
||||||
this.addCell(excel, row, vo, field, column++);
|
if (Collection.class.isAssignableFrom(field.getType()) && StringUtils.isNotNull(subList))
|
||||||
|
{
|
||||||
|
boolean subFirst = false;
|
||||||
|
for (Object obj : subList)
|
||||||
|
{
|
||||||
|
if (subFirst)
|
||||||
|
{
|
||||||
|
rowNo++;
|
||||||
|
row = sheet.createRow(rowNo);
|
||||||
|
}
|
||||||
|
List<Field> subFields = FieldUtils.getFieldsListWithAnnotation(obj.getClass(), Excel.class);
|
||||||
|
int subIndex = 0;
|
||||||
|
for (Field subField : subFields)
|
||||||
|
{
|
||||||
|
if (subField.isAnnotationPresent(Excel.class))
|
||||||
|
{
|
||||||
|
subField.setAccessible(true);
|
||||||
|
Excel attr = subField.getAnnotation(Excel.class);
|
||||||
|
this.addCell(attr, row, (T) obj, subField, column + subIndex);
|
||||||
|
}
|
||||||
|
subIndex++;
|
||||||
|
}
|
||||||
|
subFirst = true;
|
||||||
|
}
|
||||||
|
this.subMergedFirstRowNum = this.subMergedFirstRowNum + subList.size();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.addCell(excel, row, vo, field, column++);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -649,20 +776,6 @@ public class ExcelUtil<T>
|
|||||||
style.setFont(dataFont);
|
style.setFont(dataFont);
|
||||||
styles.put("data", style);
|
styles.put("data", style);
|
||||||
|
|
||||||
style = wb.createCellStyle();
|
|
||||||
style.cloneStyleFrom(styles.get("data"));
|
|
||||||
style.setAlignment(HorizontalAlignment.CENTER);
|
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
||||||
style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
|
||||||
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
||||||
Font headerFont = wb.createFont();
|
|
||||||
headerFont.setFontName("Arial");
|
|
||||||
headerFont.setFontHeightInPoints((short) 10);
|
|
||||||
headerFont.setBold(true);
|
|
||||||
headerFont.setColor(IndexedColors.WHITE.getIndex());
|
|
||||||
style.setFont(headerFont);
|
|
||||||
styles.put("header", style);
|
|
||||||
|
|
||||||
style = wb.createCellStyle();
|
style = wb.createCellStyle();
|
||||||
style.setAlignment(HorizontalAlignment.CENTER);
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
@ -672,24 +785,60 @@ public class ExcelUtil<T>
|
|||||||
style.setFont(totalFont);
|
style.setFont(totalFont);
|
||||||
styles.put("total", style);
|
styles.put("total", style);
|
||||||
|
|
||||||
styles.putAll(annotationStyles(wb));
|
styles.putAll(annotationHeaderStyles(wb, styles));
|
||||||
|
|
||||||
|
styles.putAll(annotationDataStyles(wb));
|
||||||
|
|
||||||
return styles;
|
return styles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据Excel注解创建表格样式
|
* 根据Excel注解创建表格头样式
|
||||||
*
|
*
|
||||||
* @param wb 工作薄对象
|
* @param wb 工作薄对象
|
||||||
* @return 自定义样式列表
|
* @return 自定义样式列表
|
||||||
*/
|
*/
|
||||||
private Map<String, CellStyle> annotationStyles(Workbook wb)
|
private Map<String, CellStyle> annotationHeaderStyles(Workbook wb, Map<String, CellStyle> styles)
|
||||||
|
{
|
||||||
|
Map<String, CellStyle> headerStyles = new HashMap<String, CellStyle>();
|
||||||
|
for (Object[] os : fields)
|
||||||
|
{
|
||||||
|
Excel excel = (Excel) os[1];
|
||||||
|
String key = StringUtils.format("header_{}_{}", excel.headerColor(), excel.headerBackgroundColor());
|
||||||
|
if (!headerStyles.containsKey(key))
|
||||||
|
{
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style = wb.createCellStyle();
|
||||||
|
style.cloneStyleFrom(styles.get("data"));
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
style.setFillForegroundColor(excel.headerBackgroundColor().index);
|
||||||
|
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||||
|
Font headerFont = wb.createFont();
|
||||||
|
headerFont.setFontName("Arial");
|
||||||
|
headerFont.setFontHeightInPoints((short) 10);
|
||||||
|
headerFont.setBold(true);
|
||||||
|
headerFont.setColor(excel.headerColor().index);
|
||||||
|
style.setFont(headerFont);
|
||||||
|
headerStyles.put(key, style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return headerStyles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Excel注解创建表格列样式
|
||||||
|
*
|
||||||
|
* @param wb 工作薄对象
|
||||||
|
* @return 自定义样式列表
|
||||||
|
*/
|
||||||
|
private Map<String, CellStyle> annotationDataStyles(Workbook wb)
|
||||||
{
|
{
|
||||||
Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
|
Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
|
||||||
for (Object[] os : fields)
|
for (Object[] os : fields)
|
||||||
{
|
{
|
||||||
Excel excel = (Excel) os[1];
|
Excel excel = (Excel) os[1];
|
||||||
String key = "data_" + excel.align() + "_" + excel.color();
|
String key = StringUtils.format("data_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor());
|
||||||
if (!styles.containsKey(key))
|
if (!styles.containsKey(key))
|
||||||
{
|
{
|
||||||
CellStyle style = wb.createCellStyle();
|
CellStyle style = wb.createCellStyle();
|
||||||
@ -704,6 +853,8 @@ public class ExcelUtil<T>
|
|||||||
style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
||||||
style.setBorderBottom(BorderStyle.THIN);
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
||||||
|
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||||
|
style.setFillForegroundColor(excel.backgroundColor().getIndex());
|
||||||
Font dataFont = wb.createFont();
|
Font dataFont = wb.createFont();
|
||||||
dataFont.setFontName("Arial");
|
dataFont.setFontName("Arial");
|
||||||
dataFont.setFontHeightInPoints((short) 10);
|
dataFont.setFontHeightInPoints((short) 10);
|
||||||
@ -718,14 +869,23 @@ public class ExcelUtil<T>
|
|||||||
/**
|
/**
|
||||||
* 创建单元格
|
* 创建单元格
|
||||||
*/
|
*/
|
||||||
public Cell createCell(Excel attr, Row row, int column)
|
public Cell createHeadCell(Excel attr, Row row, int column)
|
||||||
{
|
{
|
||||||
// 创建列
|
// 创建列
|
||||||
Cell cell = row.createCell(column);
|
Cell cell = row.createCell(column);
|
||||||
// 写入列信息
|
// 写入列信息
|
||||||
cell.setCellValue(attr.name());
|
cell.setCellValue(attr.name());
|
||||||
setDataValidation(attr, row, column);
|
setDataValidation(attr, row, column);
|
||||||
cell.setCellStyle(styles.get("header"));
|
cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
|
||||||
|
if (isSubList())
|
||||||
|
{
|
||||||
|
// 填充默认样式,防止合并单元格样式失效
|
||||||
|
sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor())));
|
||||||
|
if (attr.needMerge())
|
||||||
|
{
|
||||||
|
sheet.addMergedRegion(new CellRangeAddress(rownum - 1, rownum, column, column));
|
||||||
|
}
|
||||||
|
}
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,7 +993,12 @@ public class ExcelUtil<T>
|
|||||||
{
|
{
|
||||||
// 创建cell
|
// 创建cell
|
||||||
cell = row.createCell(column);
|
cell = row.createCell(column);
|
||||||
cell.setCellStyle(styles.get("data_" + attr.align() + "_" + attr.color()));
|
if (isSubListValue(vo) && getListCellValue(vo).size() > 1 && attr.needMerge())
|
||||||
|
{
|
||||||
|
CellRangeAddress cellAddress = new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column);
|
||||||
|
sheet.addMergedRegion(cellAddress);
|
||||||
|
}
|
||||||
|
cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor())));
|
||||||
|
|
||||||
// 用于读取对象中的属性
|
// 用于读取对象中的属性
|
||||||
Object value = getTargetValue(vo, field, attr);
|
Object value = getTargetValue(vo, field, attr);
|
||||||
@ -855,7 +1020,7 @@ public class ExcelUtil<T>
|
|||||||
}
|
}
|
||||||
else if (value instanceof BigDecimal && -1 != attr.scale())
|
else if (value instanceof BigDecimal && -1 != attr.scale())
|
||||||
{
|
{
|
||||||
cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString());
|
cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).doubleValue());
|
||||||
}
|
}
|
||||||
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
||||||
{
|
{
|
||||||
@ -928,7 +1093,7 @@ public class ExcelUtil<T>
|
|||||||
for (String item : convertSource)
|
for (String item : convertSource)
|
||||||
{
|
{
|
||||||
String[] itemArray = item.split("=");
|
String[] itemArray = item.split("=");
|
||||||
if (StringUtils.containsAny(separator, propertyValue))
|
if (StringUtils.containsAny(propertyValue, separator))
|
||||||
{
|
{
|
||||||
for (String value : propertyValue.split(separator))
|
for (String value : propertyValue.split(separator))
|
||||||
{
|
{
|
||||||
@ -965,7 +1130,7 @@ public class ExcelUtil<T>
|
|||||||
for (String item : convertSource)
|
for (String item : convertSource)
|
||||||
{
|
{
|
||||||
String[] itemArray = item.split("=");
|
String[] itemArray = item.split("=");
|
||||||
if (StringUtils.containsAny(separator, propertyValue))
|
if (StringUtils.containsAny(propertyValue, separator))
|
||||||
{
|
{
|
||||||
for (String value : propertyValue.split(separator))
|
for (String value : propertyValue.split(separator))
|
||||||
{
|
{
|
||||||
@ -1178,29 +1343,39 @@ public class ExcelUtil<T>
|
|||||||
tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
|
tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
|
||||||
for (Field field : tempFields)
|
for (Field field : tempFields)
|
||||||
{
|
{
|
||||||
// 单注解
|
if (!ArrayUtils.contains(this.excludeFields, field.getName()))
|
||||||
if (field.isAnnotationPresent(Excel.class))
|
|
||||||
{
|
{
|
||||||
Excel attr = field.getAnnotation(Excel.class);
|
// 单注解
|
||||||
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
if (field.isAnnotationPresent(Excel.class))
|
||||||
{
|
|
||||||
field.setAccessible(true);
|
|
||||||
fields.add(new Object[] { field, attr });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 多注解
|
|
||||||
if (field.isAnnotationPresent(Excels.class))
|
|
||||||
{
|
|
||||||
Excels attrs = field.getAnnotation(Excels.class);
|
|
||||||
Excel[] excels = attrs.value();
|
|
||||||
for (Excel attr : excels)
|
|
||||||
{
|
{
|
||||||
|
Excel attr = field.getAnnotation(Excel.class);
|
||||||
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
||||||
{
|
{
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
fields.add(new Object[] { field, attr });
|
fields.add(new Object[] { field, attr });
|
||||||
}
|
}
|
||||||
|
if (Collection.class.isAssignableFrom(field.getType()))
|
||||||
|
{
|
||||||
|
subMethod = getSubMethod(field.getName(), clazz);
|
||||||
|
ParameterizedType pt = (ParameterizedType) field.getGenericType();
|
||||||
|
Class<?> subClass = (Class<?>) pt.getActualTypeArguments()[0];
|
||||||
|
this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多注解
|
||||||
|
if (field.isAnnotationPresent(Excels.class))
|
||||||
|
{
|
||||||
|
Excels attrs = field.getAnnotation(Excels.class);
|
||||||
|
Excel[] excels = attrs.value();
|
||||||
|
for (Excel attr : excels)
|
||||||
|
{
|
||||||
|
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
||||||
|
{
|
||||||
|
field.setAccessible(true);
|
||||||
|
fields.add(new Object[] { field, attr });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1429,4 +1604,61 @@ public class ExcelUtil<T>
|
|||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有对象的子列表
|
||||||
|
*/
|
||||||
|
public boolean isSubList()
|
||||||
|
{
|
||||||
|
return StringUtils.isNotNull(subFields) && subFields.size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有对象的子列表,集合不为空
|
||||||
|
*/
|
||||||
|
public boolean isSubListValue(T vo)
|
||||||
|
{
|
||||||
|
return StringUtils.isNotNull(subFields) && subFields.size() > 0 && StringUtils.isNotNull(getListCellValue(vo)) && getListCellValue(vo).size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取集合的值
|
||||||
|
*/
|
||||||
|
public Collection<?> getListCellValue(Object obj)
|
||||||
|
{
|
||||||
|
Object value;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
value = subMethod.invoke(obj, new Object[] {});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return new ArrayList<Object>();
|
||||||
|
}
|
||||||
|
return (Collection<?>) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对象的子列表方法
|
||||||
|
*
|
||||||
|
* @param name 名称
|
||||||
|
* @param pojoClass 类对象
|
||||||
|
* @return 子列表方法
|
||||||
|
*/
|
||||||
|
public Method getSubMethod(String name, Class<?> pojoClass)
|
||||||
|
{
|
||||||
|
StringBuffer getMethodName = new StringBuffer("get");
|
||||||
|
getMethodName.append(name.substring(0, 1).toUpperCase());
|
||||||
|
getMethodName.append(name.substring(1));
|
||||||
|
Method method = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
method = pojoClass.getMethod(getMethodName.toString(), new Class[] {});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.error("获取对象异常{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return method;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.ruoyi.framework.aspectj;
|
package com.ruoyi.framework.aspectj;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
@ -9,8 +11,10 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.framework.security.context.PermissionContextHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据过滤处理
|
* 数据过滤处理
|
||||||
@ -68,8 +72,9 @@ public class DataScopeAspect
|
|||||||
// 如果是超级管理员,则不过滤数据
|
// 如果是超级管理员,则不过滤数据
|
||||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||||
{
|
{
|
||||||
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext());
|
||||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||||
controllerDataScope.userAlias());
|
controllerDataScope.userAlias(), permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,15 +84,27 @@ public class DataScopeAspect
|
|||||||
*
|
*
|
||||||
* @param joinPoint 切点
|
* @param joinPoint 切点
|
||||||
* @param user 用户
|
* @param user 用户
|
||||||
* @param userAlias 别名
|
* @param deptAlias 部门别名
|
||||||
|
* @param userAlias 用户别名
|
||||||
|
* @param permission 权限字符
|
||||||
*/
|
*/
|
||||||
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
|
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, String permission)
|
||||||
{
|
{
|
||||||
StringBuilder sqlString = new StringBuilder();
|
StringBuilder sqlString = new StringBuilder();
|
||||||
|
List<String> conditions = new ArrayList<String>();
|
||||||
|
|
||||||
for (SysRole role : user.getRoles())
|
for (SysRole role : user.getRoles())
|
||||||
{
|
{
|
||||||
String dataScope = role.getDataScope();
|
String dataScope = role.getDataScope();
|
||||||
|
if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(permission) && StringUtils.isNotEmpty(role.getPermissions())
|
||||||
|
&& !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (DATA_SCOPE_ALL.equals(dataScope))
|
if (DATA_SCOPE_ALL.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString = new StringBuilder();
|
sqlString = new StringBuilder();
|
||||||
@ -121,6 +138,7 @@ public class DataScopeAspect
|
|||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
conditions.add(dataScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
if (StringUtils.isNotBlank(sqlString.toString()))
|
||||||
|
@ -19,10 +19,11 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.enums.BusinessStatus;
|
import com.ruoyi.common.enums.BusinessStatus;
|
||||||
import com.ruoyi.common.enums.HttpMethod;
|
import com.ruoyi.common.enums.HttpMethod;
|
||||||
|
import com.ruoyi.common.filter.PropertyPreExcludeFilter;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.ip.IpUtils;
|
import com.ruoyi.common.utils.ip.IpUtils;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
@ -38,6 +39,9 @@ public class LogAspect
|
|||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
||||||
|
|
||||||
|
/** 排除敏感属性字段 */
|
||||||
|
public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理完请求后执行
|
* 处理完请求后执行
|
||||||
*
|
*
|
||||||
@ -168,7 +172,7 @@ public class LogAspect
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object jsonObj = JSON.toJSON(o);
|
String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter());
|
||||||
params += jsonObj.toString() + " ";
|
params += jsonObj.toString() + " ";
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@ -180,6 +184,14 @@ public class LogAspect
|
|||||||
return params.trim();
|
return params.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略敏感属性
|
||||||
|
*/
|
||||||
|
public PropertyPreExcludeFilter excludePropertyPreFilter()
|
||||||
|
{
|
||||||
|
return new PropertyPreExcludeFilter().addExcludes(EXCLUDE_PROPERTIES);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否需要过滤的对象。
|
* 判断是否需要过滤的对象。
|
||||||
*
|
*
|
||||||
|
@ -5,7 +5,7 @@ import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码文本生成器
|
* 验证码文本生成器
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class KaptchaTextCreator extends DefaultTextCreator
|
public class KaptchaTextCreator extends DefaultTextCreator
|
||||||
@ -20,7 +20,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
|
|||||||
int x = random.nextInt(10);
|
int x = random.nextInt(10);
|
||||||
int y = random.nextInt(10);
|
int y = random.nextInt(10);
|
||||||
StringBuilder suChinese = new StringBuilder();
|
StringBuilder suChinese = new StringBuilder();
|
||||||
int randomoperands = (int) Math.round(Math.random() * 2);
|
int randomoperands = random.nextInt(3);
|
||||||
if (randomoperands == 0)
|
if (randomoperands == 0)
|
||||||
{
|
{
|
||||||
result = x * y;
|
result = x * y;
|
||||||
@ -30,7 +30,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
|
|||||||
}
|
}
|
||||||
else if (randomoperands == 1)
|
else if (randomoperands == 1)
|
||||||
{
|
{
|
||||||
if (!(x == 0) && y % x == 0)
|
if ((x != 0) && y % x == 0)
|
||||||
{
|
{
|
||||||
result = y / x;
|
result = y / x;
|
||||||
suChinese.append(CNUMBERS[y]);
|
suChinese.append(CNUMBERS[y]);
|
||||||
@ -45,7 +45,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
|
|||||||
suChinese.append(CNUMBERS[y]);
|
suChinese.append(CNUMBERS[y]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (randomoperands == 2)
|
else
|
||||||
{
|
{
|
||||||
if (x >= y)
|
if (x >= y)
|
||||||
{
|
{
|
||||||
@ -62,13 +62,6 @@ public class KaptchaTextCreator extends DefaultTextCreator
|
|||||||
suChinese.append(CNUMBERS[x]);
|
suChinese.append(CNUMBERS[x]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
result = x + y;
|
|
||||||
suChinese.append(CNUMBERS[x]);
|
|
||||||
suChinese.append("+");
|
|
||||||
suChinese.append(CNUMBERS[y]);
|
|
||||||
}
|
|
||||||
suChinese.append("=?@" + result);
|
suChinese.append("=?@" + result);
|
||||||
return suChinese.toString();
|
return suChinese.toString();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.ruoyi.framework.security.context;
|
||||||
|
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份验证信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class AuthenticationContextHolder
|
||||||
|
{
|
||||||
|
private static final ThreadLocal<Authentication> contextHolder = new ThreadLocal<>();
|
||||||
|
|
||||||
|
public static Authentication getContext()
|
||||||
|
{
|
||||||
|
return contextHolder.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setContext(Authentication context)
|
||||||
|
{
|
||||||
|
contextHolder.set(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearContext()
|
||||||
|
{
|
||||||
|
contextHolder.remove();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.framework.security.context;
|
||||||
|
|
||||||
|
import org.springframework.web.context.request.RequestAttributes;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class PermissionContextHolder
|
||||||
|
{
|
||||||
|
private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT";
|
||||||
|
|
||||||
|
public static void setContext(String permission)
|
||||||
|
{
|
||||||
|
RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission,
|
||||||
|
RequestAttributes.SCOPE_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getContext()
|
||||||
|
{
|
||||||
|
return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES,
|
||||||
|
RequestAttributes.SCOPE_REQUEST));
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
|||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.framework.security.context.PermissionContextHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母
|
* RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母
|
||||||
@ -43,6 +44,7 @@ public class PermissionService
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
PermissionContextHolder.setContext(permission);
|
||||||
return hasPermissions(loginUser.getPermissions(), permission);
|
return hasPermissions(loginUser.getPermissions(), permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +76,7 @@ public class PermissionService
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
PermissionContextHolder.setContext(permissions);
|
||||||
Set<String> authorities = loginUser.getPermissions();
|
Set<String> authorities = loginUser.getPermissions();
|
||||||
for (String permission : permissions.split(PERMISSION_DELIMETER))
|
for (String permission : permissions.split(PERMISSION_DELIMETER))
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||||||
import com.ruoyi.common.utils.ip.IpUtils;
|
import com.ruoyi.common.utils.ip.IpUtils;
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||||
|
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
|
||||||
@ -60,9 +61,9 @@ public class SysLoginService
|
|||||||
*/
|
*/
|
||||||
public String login(String username, String password, String code, String uuid)
|
public String login(String username, String password, String code, String uuid)
|
||||||
{
|
{
|
||||||
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
if (captchaOnOff)
|
if (captchaEnabled)
|
||||||
{
|
{
|
||||||
validateCaptcha(username, code, uuid);
|
validateCaptcha(username, code, uuid);
|
||||||
}
|
}
|
||||||
@ -70,9 +71,10 @@ public class SysLoginService
|
|||||||
Authentication authentication = null;
|
Authentication authentication = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
|
||||||
|
AuthenticationContextHolder.setContext(authenticationToken);
|
||||||
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
||||||
authentication = authenticationManager
|
authentication = authenticationManager.authenticate(authenticationToken);
|
||||||
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -87,6 +89,10 @@ public class SysLoginService
|
|||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
AuthenticationContextHolder.clearContext();
|
||||||
|
}
|
||||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||||
recordLoginInfo(loginUser.getUserId());
|
recordLoginInfo(loginUser.getUserId());
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
|
||||||
|
import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException;
|
||||||
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||||
|
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录密码方法
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SysPasswordService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Value(value = "${user.password.maxRetryCount}")
|
||||||
|
private int maxRetryCount;
|
||||||
|
|
||||||
|
@Value(value = "${user.password.lockTime}")
|
||||||
|
private int lockTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账户密码错误次数缓存键名
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
private String getCacheKey(String username)
|
||||||
|
{
|
||||||
|
return CacheConstants.PWD_ERR_CNT_KEY + username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void validate(SysUser user)
|
||||||
|
{
|
||||||
|
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
|
||||||
|
String username = usernamePasswordAuthenticationToken.getName();
|
||||||
|
String password = usernamePasswordAuthenticationToken.getCredentials().toString();
|
||||||
|
|
||||||
|
Integer retryCount = redisCache.getCacheObject(getCacheKey(username));
|
||||||
|
|
||||||
|
if (retryCount == null)
|
||||||
|
{
|
||||||
|
retryCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retryCount >= Integer.valueOf(maxRetryCount).intValue())
|
||||||
|
{
|
||||||
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL,
|
||||||
|
MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount, lockTime)));
|
||||||
|
throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!matches(user, password))
|
||||||
|
{
|
||||||
|
retryCount = retryCount + 1;
|
||||||
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL,
|
||||||
|
MessageUtils.message("user.password.retry.limit.count", retryCount)));
|
||||||
|
redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
||||||
|
throw new UserPasswordNotMatchException();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearLoginRecordCache(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean matches(SysUser user, String rawPassword)
|
||||||
|
{
|
||||||
|
return SecurityUtils.matchesPassword(rawPassword, user.getPassword());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearLoginRecordCache(String loginName)
|
||||||
|
{
|
||||||
|
if (redisCache.hasKey(getCacheKey(loginName)))
|
||||||
|
{
|
||||||
|
redisCache.deleteObject(getCacheKey(loginName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,11 @@
|
|||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
@ -59,7 +61,21 @@ public class SysPermissionService
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
|
List<SysRole> roles = user.getRoles();
|
||||||
|
if (!roles.isEmpty() && roles.size() > 1)
|
||||||
|
{
|
||||||
|
// 多角色设置permissions属性,以便数据权限匹配权限
|
||||||
|
for (SysRole role : roles)
|
||||||
|
{
|
||||||
|
Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
||||||
|
role.setPermissions(rolePerms);
|
||||||
|
perms.addAll(rolePerms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return perms;
|
return perms;
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,9 @@ public class SysRegisterService
|
|||||||
{
|
{
|
||||||
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
||||||
|
|
||||||
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
if (captchaOnOff)
|
if (captchaEnabled)
|
||||||
{
|
{
|
||||||
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
|
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,9 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
@ -52,6 +55,8 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// passwordService.validate(user);
|
||||||
|
|
||||||
return createLoginUser(user);
|
return createLoginUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,8 +492,8 @@ function handleAdd() {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
const ${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
|
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
|
||||||
get${BusinessName}(${pkColumn.javaField}).then(response => {
|
get${BusinessName}(_${pkColumn.javaField}).then(response => {
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
@ -539,9 +539,9 @@ function submitForm() {
|
|||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
|
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(${pkColumn.javaField}s);
|
return del${BusinessName}(_${pkColumn.javaField}s);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList();
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
|
@ -167,8 +167,8 @@ public class SysJobController extends BaseController
|
|||||||
@PutMapping("/run")
|
@PutMapping("/run")
|
||||||
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
||||||
{
|
{
|
||||||
jobService.run(job);
|
boolean result = jobService.run(job);
|
||||||
return AjaxResult.success();
|
return result ? success() : error("任务不存在或已过期!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -180,6 +180,6 @@ public class SysJobController extends BaseController
|
|||||||
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
|
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
|
||||||
{
|
{
|
||||||
jobService.deleteJobByIds(jobIds);
|
jobService.deleteJobByIds(jobIds);
|
||||||
return AjaxResult.success();
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public interface ISysJobService
|
|||||||
* @param job 调度信息
|
* @param job 调度信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void run(SysJob job) throws SchedulerException;
|
public boolean run(SysJob job) throws SchedulerException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增任务
|
* 新增任务
|
||||||
|
@ -174,15 +174,22 @@ public class SysJobServiceImpl implements ISysJobService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void run(SysJob job) throws SchedulerException
|
public boolean run(SysJob job) throws SchedulerException
|
||||||
{
|
{
|
||||||
|
boolean result = false;
|
||||||
Long jobId = job.getJobId();
|
Long jobId = job.getJobId();
|
||||||
String jobGroup = job.getJobGroup();
|
String jobGroup = job.getJobGroup();
|
||||||
SysJob properties = selectJobById(job.getJobId());
|
SysJob properties = selectJobById(job.getJobId());
|
||||||
// 参数
|
// 参数
|
||||||
JobDataMap dataMap = new JobDataMap();
|
JobDataMap dataMap = new JobDataMap();
|
||||||
dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties);
|
dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties);
|
||||||
scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap);
|
JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
|
||||||
|
if (scheduler.checkExists(jobKey))
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
scheduler.triggerJob(jobKey, dataMap);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,12 +52,12 @@ public class JobInvokeUtil
|
|||||||
{
|
{
|
||||||
if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0)
|
if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0)
|
||||||
{
|
{
|
||||||
Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams));
|
Method method = bean.getClass().getMethod(methodName, getMethodParamsType(methodParams));
|
||||||
method.invoke(bean, getMethodParamsValue(methodParams));
|
method.invoke(bean, getMethodParamsValue(methodParams));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Method method = bean.getClass().getDeclaredMethod(methodName);
|
Method method = bean.getClass().getMethod(methodName);
|
||||||
method.invoke(bean);
|
method.invoke(bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,12 @@ public class ScheduleUtils
|
|||||||
scheduler.deleteJob(getJobKey(jobId, jobGroup));
|
scheduler.deleteJob(getJobKey(jobId, jobGroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduler.scheduleJob(jobDetail, trigger);
|
// 判断任务是否过期
|
||||||
|
if (StringUtils.isNotNull(CronUtils.getNextExecution(job.getCronExpression())))
|
||||||
|
{
|
||||||
|
// 执行调度任务
|
||||||
|
scheduler.scheduleJob(jobDetail, trigger);
|
||||||
|
}
|
||||||
|
|
||||||
// 暂停任务
|
// 暂停任务
|
||||||
if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue()))
|
if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue()))
|
||||||
|
@ -34,6 +34,14 @@ public interface SysMenuMapper
|
|||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色ID查询权限
|
||||||
|
*
|
||||||
|
* @param roleId 角色ID
|
||||||
|
* @return 权限列表
|
||||||
|
*/
|
||||||
|
public List<String> selectMenuPermsByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@ public interface ISysConfigService
|
|||||||
*
|
*
|
||||||
* @return true开启,false关闭
|
* @return true开启,false关闭
|
||||||
*/
|
*/
|
||||||
public boolean selectCaptchaOnOff();
|
public boolean selectCaptchaEnabled();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
|
@ -19,6 +19,14 @@ public interface ISysDeptService
|
|||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList(SysDept dept);
|
public List<SysDept> selectDeptList(SysDept dept);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门树结构信息
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 部门树信息集合
|
||||||
|
*/
|
||||||
|
public List<TreeSelect> selectDeptTreeList(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
*
|
*
|
||||||
|
@ -38,6 +38,14 @@ public interface ISysMenuService
|
|||||||
*/
|
*/
|
||||||
public Set<String> selectMenuPermsByUserId(Long userId);
|
public Set<String> selectMenuPermsByUserId(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色ID查询权限
|
||||||
|
*
|
||||||
|
* @param roleId 角色ID
|
||||||
|
* @return 权限列表
|
||||||
|
*/
|
||||||
|
public Set<String> selectMenuPermsByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单树信息
|
* 根据用户ID查询菜单树信息
|
||||||
*
|
*
|
||||||
|
@ -86,14 +86,14 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||||||
* @return true开启,false关闭
|
* @return true开启,false关闭
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean selectCaptchaOnOff()
|
public boolean selectCaptchaEnabled()
|
||||||
{
|
{
|
||||||
String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
|
String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
|
||||||
if (StringUtils.isEmpty(captchaOnOff))
|
if (StringUtils.isEmpty(captchaEnabled))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return Convert.toBool(captchaOnOff);
|
return Convert.toBool(captchaEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,6 +48,19 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||||||
return deptMapper.selectDeptList(dept);
|
return deptMapper.selectDeptList(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门树结构信息
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 部门树信息集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TreeSelect> selectDeptTreeList(SysDept dept)
|
||||||
|
{
|
||||||
|
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
||||||
|
return buildDeptTreeSelect(depts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
*
|
*
|
||||||
|
@ -100,6 +100,27 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||||||
return permsSet;
|
return permsSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色ID查询权限
|
||||||
|
*
|
||||||
|
* @param roleId 角色ID
|
||||||
|
* @return 权限列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Set<String> selectMenuPermsByRoleId(Long roleId)
|
||||||
|
{
|
||||||
|
List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
|
||||||
|
Set<String> permsSet = new HashSet<>();
|
||||||
|
for (String perm : perms)
|
||||||
|
{
|
||||||
|
if (StringUtils.isNotEmpty(perm))
|
||||||
|
{
|
||||||
|
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return permsSet;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
@ -508,7 +529,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||||||
*/
|
*/
|
||||||
public String innerLinkReplaceEach(String path)
|
public String innerLinkReplaceEach(String path)
|
||||||
{
|
{
|
||||||
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS },
|
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." },
|
||||||
new String[] { "", "" });
|
new String[] { "", "", "", "/" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertDept" parameterType="SysDept">
|
<insert id="insertDept" parameterType="SysDept">
|
||||||
|
@ -111,6 +111,13 @@
|
|||||||
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
|
||||||
|
select distinct m.perms
|
||||||
|
from sys_menu m
|
||||||
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||||
|
where m.status = '0' and rm.role_id = #{roleId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||||
<include refid="selectMenuVo"/>
|
<include refid="selectMenuVo"/>
|
||||||
where menu_id = #{menuId}
|
where menu_id = #{menuId}
|
||||||
|
@ -85,12 +85,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_name=#{roleName} limit 1
|
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_key=#{roleKey} limit 1
|
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteRoleById" parameterType="Long">
|
<delete id="deleteRoleById" parameterType="Long">
|
||||||
update sys_role set del_flag = '2' where role_id = #{roleId}
|
update sys_role set del_flag = '2' where role_id = #{roleId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteRoleByIds" parameterType="Long">
|
<delete id="deleteRoleByIds" parameterType="Long">
|
||||||
|
@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||||
<include refid="selectUserVo"/>
|
<include refid="selectUserVo"/>
|
||||||
where u.user_name = #{userName}
|
where u.user_name = #{userName} and u.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||||
@ -131,15 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
||||||
select count(1) from sys_user where user_name = #{userName} limit 1
|
select count(1) from sys_user where user_name = #{userName} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
|
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, email from sys_user where email = #{email} limit 1
|
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
@ -208,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteUserById" parameterType="Long">
|
<delete id="deleteUserById" parameterType="Long">
|
||||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteUserByIds" parameterType="Long">
|
<delete id="deleteUserByIds" parameterType="Long">
|
||||||
|
@ -17,6 +17,14 @@ export function delLogininfor(infoId) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 解锁用户登录状态
|
||||||
|
export function unlockLogininfor(userName) {
|
||||||
|
return request({
|
||||||
|
url: '/monitor/logininfor/unlock/' + userName,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 清空登录日志
|
// 清空登录日志
|
||||||
export function cleanLogininfor() {
|
export function cleanLogininfor() {
|
||||||
return request({
|
return request({
|
||||||
|
@ -25,22 +25,6 @@ export function getDept(deptId) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询部门下拉树结构
|
|
||||||
export function treeselect() {
|
|
||||||
return request({
|
|
||||||
url: '/system/dept/treeselect',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据角色ID查询部门树结构
|
|
||||||
export function roleDeptTreeselect(roleId) {
|
|
||||||
return request({
|
|
||||||
url: '/system/dept/roleDeptTreeselect/' + roleId,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增部门
|
// 新增部门
|
||||||
export function addDept(data) {
|
export function addDept(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -108,4 +108,12 @@ export function authUserSelectAll(data) {
|
|||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据角色ID查询部门树结构
|
||||||
|
export function deptTreeSelect(roleId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/role/deptTree/' + roleId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -125,3 +125,11 @@ export function updateAuthRole(data) {
|
|||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询部门下拉树结构
|
||||||
|
export function deptTreeSelect() {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/deptTree',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -12,11 +12,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fade-transform */
|
/* fade-transform */
|
||||||
|
.fade-transform--move,
|
||||||
.fade-transform-leave-active,
|
.fade-transform-leave-active,
|
||||||
.fade-transform-enter-active {
|
.fade-transform-enter-active {
|
||||||
transition: all .5s;
|
transition: all .5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fade-transform-leave-active {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
.fade-transform-enter {
|
.fade-transform-enter {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-30px);
|
transform: translateX(-30px);
|
||||||
|
@ -1,7 +1,23 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
import store from '@/store'
|
||||||
import DataDict from '@/utils/dict'
|
import DataDict from '@/utils/dict'
|
||||||
import { getDicts as getDicts } from '@/api/system/dict/data'
|
import { getDicts as getDicts } from '@/api/system/dict/data'
|
||||||
|
|
||||||
|
function searchDictByKey(dict, key) {
|
||||||
|
if (key == null && key == "") {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
for (let i = 0; i < dict.length; i++) {
|
||||||
|
if (dict[i].key == key) {
|
||||||
|
return dict[i].value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
Vue.use(DataDict, {
|
Vue.use(DataDict, {
|
||||||
metas: {
|
metas: {
|
||||||
@ -9,7 +25,19 @@ function install() {
|
|||||||
labelField: 'dictLabel',
|
labelField: 'dictLabel',
|
||||||
valueField: 'dictValue',
|
valueField: 'dictValue',
|
||||||
request(dictMeta) {
|
request(dictMeta) {
|
||||||
return getDicts(dictMeta.type).then(res => res.data)
|
const storeDict = searchDictByKey(store.getters.dict, dictMeta.type)
|
||||||
|
if (storeDict) {
|
||||||
|
return new Promise(resolve => { resolve(storeDict) })
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
getDicts(dictMeta.type).then(res => {
|
||||||
|
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data })
|
||||||
|
resolve(res.data)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
class="upload-file-uploader"
|
class="upload-file-uploader"
|
||||||
ref="upload"
|
ref="fileUpload"
|
||||||
>
|
>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<el-button size="mini" type="primary">选取文件</el-button>
|
<el-button size="mini" type="primary">选取文件</el-button>
|
||||||
@ -151,14 +151,16 @@ export default {
|
|||||||
this.$modal.closeLoading()
|
this.$modal.closeLoading()
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res, file) {
|
||||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
if (res.code === 200) {
|
||||||
if (this.uploadList.length === this.number) {
|
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.uploadedSuccessfully();
|
||||||
this.uploadList = [];
|
} else {
|
||||||
this.number = 0;
|
this.number--;
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
this.$refs.fileUpload.handleRemove(file);
|
||||||
|
this.uploadedSuccessfully();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除文件
|
// 删除文件
|
||||||
@ -166,6 +168,16 @@ export default {
|
|||||||
this.fileList.splice(index, 1);
|
this.fileList.splice(index, 1);
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
},
|
},
|
||||||
|
// 上传结束处理
|
||||||
|
uploadedSuccessfully() {
|
||||||
|
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||||
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
|
this.uploadList = [];
|
||||||
|
this.number = 0;
|
||||||
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
getFileName(name) {
|
getFileName(name) {
|
||||||
if (name.lastIndexOf("/") > -1) {
|
if (name.lastIndexOf("/") > -1) {
|
||||||
|
@ -19,7 +19,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
src: {
|
src: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
default: ""
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
@ -32,6 +32,9 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
realSrc() {
|
realSrc() {
|
||||||
|
if (!this.src) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let real_src = this.src.split(",")[0];
|
let real_src = this.src.split(",")[0];
|
||||||
if (isExternal(real_src)) {
|
if (isExternal(real_src)) {
|
||||||
return real_src;
|
return real_src;
|
||||||
@ -39,6 +42,9 @@ export default {
|
|||||||
return process.env.VUE_APP_BASE_API + real_src;
|
return process.env.VUE_APP_BASE_API + real_src;
|
||||||
},
|
},
|
||||||
realSrcList() {
|
realSrcList() {
|
||||||
|
if (!this.src) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let real_src_list = this.src.split(",");
|
let real_src_list = this.src.split(",");
|
||||||
let srcList = [];
|
let srcList = [];
|
||||||
real_src_list.forEach(item => {
|
real_src_list.forEach(item => {
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
:limit="limit"
|
:limit="limit"
|
||||||
:on-error="handleUploadError"
|
:on-error="handleUploadError"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
name="file"
|
ref="imageUpload"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleDelete"
|
||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
@ -117,25 +117,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 删除图片
|
|
||||||
handleRemove(file, fileList) {
|
|
||||||
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
|
||||||
if(findex > -1) {
|
|
||||||
this.fileList.splice(findex, 1);
|
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 上传成功回调
|
|
||||||
handleUploadSuccess(res) {
|
|
||||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
|
||||||
if (this.uploadList.length === this.number) {
|
|
||||||
this.fileList = this.fileList.concat(this.uploadList);
|
|
||||||
this.uploadList = [];
|
|
||||||
this.number = 0;
|
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
|
||||||
this.$modal.closeLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 上传前loading加载
|
// 上传前loading加载
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
let isImg = false;
|
let isImg = false;
|
||||||
@ -171,11 +152,42 @@ export default {
|
|||||||
handleExceed() {
|
handleExceed() {
|
||||||
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
||||||
},
|
},
|
||||||
|
// 上传成功回调
|
||||||
|
handleUploadSuccess(res, file) {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||||
|
this.uploadedSuccessfully();
|
||||||
|
} else {
|
||||||
|
this.number--;
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
this.$modal.msgError(res.msg);
|
||||||
|
this.$refs.imageUpload.handleRemove(file);
|
||||||
|
this.uploadedSuccessfully();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除图片
|
||||||
|
handleDelete(file) {
|
||||||
|
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
||||||
|
if(findex > -1) {
|
||||||
|
this.fileList.splice(findex, 1);
|
||||||
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
}
|
||||||
|
},
|
||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError() {
|
handleUploadError() {
|
||||||
this.$modal.msgError("上传图片失败,请重试");
|
this.$modal.msgError("上传图片失败,请重试");
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
},
|
},
|
||||||
|
// 上传结束处理
|
||||||
|
uploadedSuccessfully() {
|
||||||
|
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||||
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
|
this.uploadList = [];
|
||||||
|
this.number = 0;
|
||||||
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 预览
|
// 预览
|
||||||
handlePictureCardPreview(file) {
|
handlePictureCardPreview(file) {
|
||||||
this.dialogImageUrl = file.url;
|
this.dialogImageUrl = file.url;
|
||||||
@ -186,7 +198,9 @@ export default {
|
|||||||
let strs = "";
|
let strs = "";
|
||||||
separator = separator || ",";
|
separator = separator || ",";
|
||||||
for (let i in list) {
|
for (let i in list) {
|
||||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
if (list[i].url) {
|
||||||
|
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div ref="rightPanel" :class="{show:show}" class="rightPanel-container">
|
<div ref="rightPanel" class="rightPanel-container">
|
||||||
<div class="rightPanel-background" />
|
<div class="rightPanel-background" />
|
||||||
<div class="rightPanel">
|
<div class="rightPanel">
|
||||||
<div class="rightPanel-items">
|
<div class="rightPanel-items">
|
||||||
@ -10,18 +10,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addClass, removeClass } from '@/utils'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RightPanel',
|
name: 'RightPanel',
|
||||||
props: {
|
props: {
|
||||||
clickNotClose: {
|
clickNotClose: {
|
||||||
default: false,
|
default: false,
|
||||||
type: Boolean
|
type: Boolean
|
||||||
},
|
|
||||||
buttonTop: {
|
|
||||||
default: 250,
|
|
||||||
type: Number
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -35,21 +29,13 @@ export default {
|
|||||||
value: val
|
value: val
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
theme() {
|
|
||||||
return this.$store.state.settings.theme
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
show(value) {
|
show(value) {
|
||||||
if (value && !this.clickNotClose) {
|
if (value && !this.clickNotClose) {
|
||||||
this.addEventClick()
|
this.addEventClick()
|
||||||
}
|
}
|
||||||
if (value) {
|
|
||||||
addClass(document.body, 'showRightPanel')
|
|
||||||
} else {
|
|
||||||
removeClass(document.body, 'showRightPanel')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -65,7 +51,7 @@ export default {
|
|||||||
window.addEventListener('click', this.closeSidebar)
|
window.addEventListener('click', this.closeSidebar)
|
||||||
},
|
},
|
||||||
closeSidebar(evt) {
|
closeSidebar(evt) {
|
||||||
const parent = evt.target.closest('.rightPanel')
|
const parent = evt.target.closest('.el-drawer__body')
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
this.show = false
|
this.show = false
|
||||||
window.removeEventListener('click', this.closeSidebar)
|
window.removeEventListener('click', this.closeSidebar)
|
||||||
@ -80,14 +66,6 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
.showRightPanel {
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
width: calc(100% - 15px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.rightPanel-background {
|
.rightPanel-background {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -113,21 +91,6 @@ export default {
|
|||||||
z-index: 40000;
|
z-index: 40000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
|
||||||
transition: all .3s cubic-bezier(.7, .3, .1, 1);
|
|
||||||
|
|
||||||
.rightPanel-background {
|
|
||||||
z-index: 20000;
|
|
||||||
opacity: 1;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightPanel {
|
|
||||||
transform: translate(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.handle-button {
|
.handle-button {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="top-right-btn">
|
<div class="top-right-btn" :style="style">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
|
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="search">
|
||||||
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
|
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
||||||
@ -42,6 +42,23 @@ export default {
|
|||||||
columns: {
|
columns: {
|
||||||
type: Array,
|
type: Array,
|
||||||
},
|
},
|
||||||
|
search: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
gutter: {
|
||||||
|
type: Number,
|
||||||
|
default: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
style() {
|
||||||
|
const ret = {};
|
||||||
|
if (this.gutter) {
|
||||||
|
ret.marginRight = `${this.gutter / 2}px`;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// 显隐列初始默认隐藏列
|
// 显隐列初始默认隐藏列
|
||||||
|
@ -2,15 +2,19 @@
|
|||||||
<section class="app-main">
|
<section class="app-main">
|
||||||
<transition name="fade-transform" mode="out-in">
|
<transition name="fade-transform" mode="out-in">
|
||||||
<keep-alive :include="cachedViews">
|
<keep-alive :include="cachedViews">
|
||||||
<router-view :key="key" />
|
<router-view v-if="!$route.meta.link" :key="key" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
|
<iframe-toggle />
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import iframeToggle from "./IframeToggle/index"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppMain',
|
name: 'AppMain',
|
||||||
|
components: { iframeToggle },
|
||||||
computed: {
|
computed: {
|
||||||
cachedViews() {
|
cachedViews() {
|
||||||
return this.$store.state.tagsView.cachedViews
|
return this.$store.state.tagsView.cachedViews
|
||||||
@ -31,7 +35,7 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-header+.app-main {
|
.fixed-header + .app-main {
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +45,7 @@ export default {
|
|||||||
min-height: calc(100vh - 84px);
|
min-height: calc(100vh - 84px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-header+.app-main {
|
.fixed-header + .app-main {
|
||||||
padding-top: 84px;
|
padding-top: 84px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
24
ruoyi-ui/src/layout/components/IframeToggle/index.vue
Normal file
24
ruoyi-ui/src/layout/components/IframeToggle/index.vue
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<transition-group name="fade-transform" mode="out-in">
|
||||||
|
<inner-link
|
||||||
|
v-for="(item, index) in iframeViews"
|
||||||
|
:key="item.path"
|
||||||
|
:iframeId="'iframe' + index"
|
||||||
|
v-show="$route.path === item.path"
|
||||||
|
:src="item.meta.link"
|
||||||
|
></inner-link>
|
||||||
|
</transition-group>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import InnerLink from "../InnerLink/index"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { InnerLink },
|
||||||
|
computed: {
|
||||||
|
iframeViews() {
|
||||||
|
return this.$store.state.tagsView.iframeViews
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,27 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="'height:' + height" v-loading="loading" element-loading-text="正在加载页面,请稍候!">
|
||||||
|
<iframe
|
||||||
|
:id="iframeId"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
:src="src"
|
||||||
|
frameborder="no"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
props: {
|
||||||
return {};
|
src: {
|
||||||
},
|
type: String,
|
||||||
render() {
|
default: "/"
|
||||||
const { $route: { meta: { link } }, } = this;
|
},
|
||||||
if ({ link }.link === "") {
|
iframeId: {
|
||||||
return "404";
|
type: String
|
||||||
}
|
}
|
||||||
let url = { link }.link;
|
|
||||||
const height = document.documentElement.clientHeight - 94.5 + "px";
|
|
||||||
const style = { height: height };
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div style={style}>
|
|
||||||
<iframe
|
|
||||||
src={url}
|
|
||||||
frameborder="no"
|
|
||||||
style="width: 100%; height: 100%"
|
|
||||||
scrolling="auto"
|
|
||||||
></iframe>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
height: document.documentElement.clientHeight - 94.5 + "px;"
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
var _this = this;
|
||||||
|
const iframeId = ("#" + this.iframeId).replace(/\//g, "\\/");
|
||||||
|
const iframe = document.querySelector(iframeId);
|
||||||
|
// iframe页面loading控制
|
||||||
|
if (iframe.attachEvent) {
|
||||||
|
this.loading = true;
|
||||||
|
iframe.attachEvent("onload", function () {
|
||||||
|
_this.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.loading = true;
|
||||||
|
iframe.onload = function () {
|
||||||
|
_this.loading = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,78 +1,76 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="drawer-container">
|
<el-drawer size="280px" :visible="visible" :with-header="false" :append-to-body="true" :show-close="false">
|
||||||
<div>
|
<div class="drawer-container">
|
||||||
<div class="setting-drawer-content">
|
<div>
|
||||||
<div class="setting-drawer-title">
|
<div class="setting-drawer-content">
|
||||||
<h3 class="drawer-title">主题风格设置</h3>
|
<div class="setting-drawer-title">
|
||||||
|
<h3 class="drawer-title">主题风格设置</h3>
|
||||||
|
</div>
|
||||||
|
<div class="setting-drawer-block-checbox">
|
||||||
|
<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')">
|
||||||
|
<img src="@/assets/images/dark.svg" alt="dark">
|
||||||
|
<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||||
|
<i aria-label="图标: check" class="anticon anticon-check">
|
||||||
|
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||||
|
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
||||||
|
</svg>
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')">
|
||||||
|
<img src="@/assets/images/light.svg" alt="light">
|
||||||
|
<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||||
|
<i aria-label="图标: check" class="anticon anticon-check">
|
||||||
|
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||||
|
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
||||||
|
</svg>
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-item">
|
||||||
|
<span>主题颜色</span>
|
||||||
|
<theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-drawer-block-checbox">
|
|
||||||
<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')">
|
<el-divider/>
|
||||||
<img src="@/assets/images/dark.svg" alt="dark">
|
|
||||||
<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
<h3 class="drawer-title">系统布局配置</h3>
|
||||||
<i aria-label="图标: check" class="anticon anticon-check">
|
|
||||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true"
|
<div class="drawer-item">
|
||||||
focusable="false" class="">
|
<span>开启 TopNav</span>
|
||||||
<path
|
<el-switch v-model="topNav" class="drawer-switch" />
|
||||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
|
||||||
</svg>
|
|
||||||
</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')">
|
|
||||||
<img src="@/assets/images/light.svg" alt="light">
|
|
||||||
<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
|
||||||
<i aria-label="图标: check" class="anticon anticon-check">
|
|
||||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true"
|
|
||||||
focusable="false" class="">
|
|
||||||
<path
|
|
||||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
|
|
||||||
</svg>
|
|
||||||
</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="drawer-item">
|
<div class="drawer-item">
|
||||||
<span>主题颜色</span>
|
<span>开启 Tags-Views</span>
|
||||||
<theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
|
<el-switch v-model="tagsView" class="drawer-switch" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-item">
|
||||||
|
<span>固定 Header</span>
|
||||||
|
<el-switch v-model="fixedHeader" class="drawer-switch" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-item">
|
||||||
|
<span>显示 Logo</span>
|
||||||
|
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-item">
|
||||||
|
<span>动态标题</span>
|
||||||
|
<el-switch v-model="dynamicTitle" class="drawer-switch" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-divider/>
|
||||||
|
|
||||||
|
<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
|
||||||
|
<el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-divider/>
|
|
||||||
|
|
||||||
<h3 class="drawer-title">系统布局配置</h3>
|
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>开启 TopNav</span>
|
|
||||||
<el-switch v-model="topNav" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>开启 Tags-Views</span>
|
|
||||||
<el-switch v-model="tagsView" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>固定 Header</span>
|
|
||||||
<el-switch v-model="fixedHeader" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>显示 Logo</span>
|
|
||||||
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>动态标题</span>
|
|
||||||
<el-switch v-model="dynamicTitle" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-divider/>
|
|
||||||
|
|
||||||
<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
|
|
||||||
<el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -87,6 +85,11 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
visible: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.settings.showSettings
|
||||||
|
}
|
||||||
|
},
|
||||||
fixedHeader: {
|
fixedHeader: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.fixedHeader
|
return this.$store.state.settings.fixedHeader
|
||||||
@ -232,7 +235,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.drawer-container {
|
.drawer-container {
|
||||||
padding: 24px;
|
padding: 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
@ -133,6 +133,9 @@ export default {
|
|||||||
const { name } = this.$route
|
const { name } = this.$route
|
||||||
if (name) {
|
if (name) {
|
||||||
this.$store.dispatch('tagsView/addView', this.$route)
|
this.$store.dispatch('tagsView/addView', this.$route)
|
||||||
|
if (this.$route.meta.link) {
|
||||||
|
this.$store.dispatch('tagsView/addIframeView', this.$route)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
@ -153,6 +156,9 @@ export default {
|
|||||||
},
|
},
|
||||||
refreshSelectedTag(view) {
|
refreshSelectedTag(view) {
|
||||||
this.$tab.refreshPage(view);
|
this.$tab.refreshPage(view);
|
||||||
|
if (this.$route.meta.link) {
|
||||||
|
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
closeSelectedTag(view) {
|
closeSelectedTag(view) {
|
||||||
this.$tab.closePage(view).then(({ visitedViews }) => {
|
this.$tab.closePage(view).then(({ visitedViews }) => {
|
||||||
|
@ -2,6 +2,7 @@ const getters = {
|
|||||||
sidebar: state => state.app.sidebar,
|
sidebar: state => state.app.sidebar,
|
||||||
size: state => state.app.size,
|
size: state => state.app.size,
|
||||||
device: state => state.app.device,
|
device: state => state.app.device,
|
||||||
|
dict: state => state.dict.dict,
|
||||||
visitedViews: state => state.tagsView.visitedViews,
|
visitedViews: state => state.tagsView.visitedViews,
|
||||||
cachedViews: state => state.tagsView.cachedViews,
|
cachedViews: state => state.tagsView.cachedViews,
|
||||||
token: state => state.user.token,
|
token: state => state.user.token,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import app from './modules/app'
|
import app from './modules/app'
|
||||||
|
import dict from './modules/dict'
|
||||||
import user from './modules/user'
|
import user from './modules/user'
|
||||||
import tagsView from './modules/tagsView'
|
import tagsView from './modules/tagsView'
|
||||||
import permission from './modules/permission'
|
import permission from './modules/permission'
|
||||||
@ -12,6 +13,7 @@ Vue.use(Vuex)
|
|||||||
const store = new Vuex.Store({
|
const store = new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
app,
|
app,
|
||||||
|
dict,
|
||||||
user,
|
user,
|
||||||
tagsView,
|
tagsView,
|
||||||
permission,
|
permission,
|
||||||
|
50
ruoyi-ui/src/store/modules/dict.js
Normal file
50
ruoyi-ui/src/store/modules/dict.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
const state = {
|
||||||
|
dict: new Array()
|
||||||
|
}
|
||||||
|
const mutations = {
|
||||||
|
SET_DICT: (state, { key, value }) => {
|
||||||
|
if (key !== null && key !== "") {
|
||||||
|
state.dict.push({
|
||||||
|
key: key,
|
||||||
|
value: value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
REMOVE_DICT: (state, key) => {
|
||||||
|
try {
|
||||||
|
for (let i = 0; i < state.dict.length; i++) {
|
||||||
|
if (state.dict[i].key == key) {
|
||||||
|
state.dict.splice(i, i)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
CLEAN_DICT: (state) => {
|
||||||
|
state.dict = new Array()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
// 设置字典
|
||||||
|
setDict({ commit }, data) {
|
||||||
|
commit('SET_DICT', data)
|
||||||
|
},
|
||||||
|
// 删除字典
|
||||||
|
removeDict({ commit }, key) {
|
||||||
|
commit('REMOVE_DICT', key)
|
||||||
|
},
|
||||||
|
// 清空字典
|
||||||
|
cleanDict({ commit }) {
|
||||||
|
commit('CLEAN_DICT')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state,
|
||||||
|
mutations,
|
||||||
|
actions
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,18 @@
|
|||||||
const state = {
|
const state = {
|
||||||
visitedViews: [],
|
visitedViews: [],
|
||||||
cachedViews: []
|
cachedViews: [],
|
||||||
|
iframeViews: []
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
ADD_IFRAME_VIEW: (state, view) => {
|
||||||
|
if (state.iframeViews.some(v => v.path === view.path)) return
|
||||||
|
state.iframeViews.push(
|
||||||
|
Object.assign({}, view, {
|
||||||
|
title: view.meta.title || 'no-name'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
},
|
||||||
ADD_VISITED_VIEW: (state, view) => {
|
ADD_VISITED_VIEW: (state, view) => {
|
||||||
if (state.visitedViews.some(v => v.path === view.path)) return
|
if (state.visitedViews.some(v => v.path === view.path)) return
|
||||||
state.visitedViews.push(
|
state.visitedViews.push(
|
||||||
@ -18,7 +27,6 @@ const mutations = {
|
|||||||
state.cachedViews.push(view.name)
|
state.cachedViews.push(view.name)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_VISITED_VIEW: (state, view) => {
|
DEL_VISITED_VIEW: (state, view) => {
|
||||||
for (const [i, v] of state.visitedViews.entries()) {
|
for (const [i, v] of state.visitedViews.entries()) {
|
||||||
if (v.path === view.path) {
|
if (v.path === view.path) {
|
||||||
@ -26,6 +34,10 @@ const mutations = {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
|
||||||
|
},
|
||||||
|
DEL_IFRAME_VIEW: (state, view) => {
|
||||||
|
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
|
||||||
},
|
},
|
||||||
DEL_CACHED_VIEW: (state, view) => {
|
DEL_CACHED_VIEW: (state, view) => {
|
||||||
const index = state.cachedViews.indexOf(view.name)
|
const index = state.cachedViews.indexOf(view.name)
|
||||||
@ -36,6 +48,7 @@ const mutations = {
|
|||||||
state.visitedViews = state.visitedViews.filter(v => {
|
state.visitedViews = state.visitedViews.filter(v => {
|
||||||
return v.meta.affix || v.path === view.path
|
return v.meta.affix || v.path === view.path
|
||||||
})
|
})
|
||||||
|
state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
|
||||||
},
|
},
|
||||||
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
||||||
const index = state.cachedViews.indexOf(view.name)
|
const index = state.cachedViews.indexOf(view.name)
|
||||||
@ -45,16 +58,15 @@ const mutations = {
|
|||||||
state.cachedViews = []
|
state.cachedViews = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_ALL_VISITED_VIEWS: state => {
|
DEL_ALL_VISITED_VIEWS: state => {
|
||||||
// keep affix tags
|
// keep affix tags
|
||||||
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
|
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
|
||||||
state.visitedViews = affixTags
|
state.visitedViews = affixTags
|
||||||
|
state.iframeViews = []
|
||||||
},
|
},
|
||||||
DEL_ALL_CACHED_VIEWS: state => {
|
DEL_ALL_CACHED_VIEWS: state => {
|
||||||
state.cachedViews = []
|
state.cachedViews = []
|
||||||
},
|
},
|
||||||
|
|
||||||
UPDATE_VISITED_VIEW: (state, view) => {
|
UPDATE_VISITED_VIEW: (state, view) => {
|
||||||
for (let v of state.visitedViews) {
|
for (let v of state.visitedViews) {
|
||||||
if (v.path === view.path) {
|
if (v.path === view.path) {
|
||||||
@ -63,7 +75,6 @@ const mutations = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_RIGHT_VIEWS: (state, view) => {
|
DEL_RIGHT_VIEWS: (state, view) => {
|
||||||
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
@ -77,10 +88,13 @@ const mutations = {
|
|||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
state.cachedViews.splice(i, 1)
|
state.cachedViews.splice(i, 1)
|
||||||
}
|
}
|
||||||
|
if(item.meta.link) {
|
||||||
|
const fi = state.iframeViews.findIndex(v => v.path === item.path)
|
||||||
|
state.iframeViews.splice(fi, 1)
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
DEL_LEFT_VIEWS: (state, view) => {
|
DEL_LEFT_VIEWS: (state, view) => {
|
||||||
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
const index = state.visitedViews.findIndex(v => v.path === view.path)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
@ -94,6 +108,10 @@ const mutations = {
|
|||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
state.cachedViews.splice(i, 1)
|
state.cachedViews.splice(i, 1)
|
||||||
}
|
}
|
||||||
|
if(item.meta.link) {
|
||||||
|
const fi = state.iframeViews.findIndex(v => v.path === item.path)
|
||||||
|
state.iframeViews.splice(fi, 1)
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -104,13 +122,15 @@ const actions = {
|
|||||||
dispatch('addVisitedView', view)
|
dispatch('addVisitedView', view)
|
||||||
dispatch('addCachedView', view)
|
dispatch('addCachedView', view)
|
||||||
},
|
},
|
||||||
|
addIframeView({ commit }, view) {
|
||||||
|
commit('ADD_IFRAME_VIEW', view)
|
||||||
|
},
|
||||||
addVisitedView({ commit }, view) {
|
addVisitedView({ commit }, view) {
|
||||||
commit('ADD_VISITED_VIEW', view)
|
commit('ADD_VISITED_VIEW', view)
|
||||||
},
|
},
|
||||||
addCachedView({ commit }, view) {
|
addCachedView({ commit }, view) {
|
||||||
commit('ADD_CACHED_VIEW', view)
|
commit('ADD_CACHED_VIEW', view)
|
||||||
},
|
},
|
||||||
|
|
||||||
delView({ dispatch, state }, view) {
|
delView({ dispatch, state }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
dispatch('delVisitedView', view)
|
dispatch('delVisitedView', view)
|
||||||
@ -127,13 +147,18 @@ const actions = {
|
|||||||
resolve([...state.visitedViews])
|
resolve([...state.visitedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
delIframeView({ commit, state }, view) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
commit('DEL_IFRAME_VIEW', view)
|
||||||
|
resolve([...state.iframeViews])
|
||||||
|
})
|
||||||
|
},
|
||||||
delCachedView({ commit, state }, view) {
|
delCachedView({ commit, state }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
commit('DEL_CACHED_VIEW', view)
|
commit('DEL_CACHED_VIEW', view)
|
||||||
resolve([...state.cachedViews])
|
resolve([...state.cachedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
delOthersViews({ dispatch, state }, view) {
|
delOthersViews({ dispatch, state }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
dispatch('delOthersVisitedViews', view)
|
dispatch('delOthersVisitedViews', view)
|
||||||
@ -156,7 +181,6 @@ const actions = {
|
|||||||
resolve([...state.cachedViews])
|
resolve([...state.cachedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
delAllViews({ dispatch, state }, view) {
|
delAllViews({ dispatch, state }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
dispatch('delAllVisitedViews', view)
|
dispatch('delAllVisitedViews', view)
|
||||||
@ -179,18 +203,15 @@ const actions = {
|
|||||||
resolve([...state.cachedViews])
|
resolve([...state.cachedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
updateVisitedView({ commit }, view) {
|
updateVisitedView({ commit }, view) {
|
||||||
commit('UPDATE_VISITED_VIEW', view)
|
commit('UPDATE_VISITED_VIEW', view)
|
||||||
},
|
},
|
||||||
|
|
||||||
delRightTags({ commit }, view) {
|
delRightTags({ commit }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
commit('DEL_RIGHT_VIEWS', view)
|
commit('DEL_RIGHT_VIEWS', view)
|
||||||
resolve([...state.visitedViews])
|
resolve([...state.visitedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
delLeftTags({ commit }, view) {
|
delLeftTags({ commit }, view) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
commit('DEL_LEFT_VIEWS', view)
|
commit('DEL_LEFT_VIEWS', view)
|
||||||
|
@ -121,8 +121,8 @@
|
|||||||
<i class="el-icon-user-solid"></i> QQ群:<s>满937441</s> <s>满887144332</s>
|
<i class="el-icon-user-solid"></i> QQ群:<s>满937441</s> <s>满887144332</s>
|
||||||
<s>满180251782</s> <s>满104180207</s> <s>满186866453</s> <s>满201396349</s>
|
<s>满180251782</s> <s>满104180207</s> <s>满186866453</s> <s>满201396349</s>
|
||||||
<s>满101456076</s> <s>满101539465</s> <s>满264312783</s> <s>满167385320</s>
|
<s>满101456076</s> <s>满101539465</s> <s>满264312783</s> <s>满167385320</s>
|
||||||
<a href="https://jq.qq.com/?_wv=1027&k=DuWxuULe" target="_blank">
|
<s>满104748341</s> <a href="https://jq.qq.com/?_wv=1027&k=0fsNiYZt" target="_blank">
|
||||||
139821253</a
|
160110482</a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaOnOff">
|
<el-form-item prop="code" v-if="captchaEnabled">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginForm.code"
|
v-model="loginForm.code"
|
||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
@ -89,7 +89,7 @@ export default {
|
|||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
captchaOnOff: true,
|
captchaEnabled: true,
|
||||||
// 注册开关
|
// 注册开关
|
||||||
register: false,
|
register: false,
|
||||||
redirect: undefined
|
redirect: undefined
|
||||||
@ -110,8 +110,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
getCodeImg().then(res => {
|
getCodeImg().then(res => {
|
||||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
||||||
if (this.captchaOnOff) {
|
if (this.captchaEnabled) {
|
||||||
this.codeUrl = "data:image/gif;base64," + res.img;
|
this.codeUrl = "data:image/gif;base64," + res.img;
|
||||||
this.loginForm.uuid = res.uuid;
|
this.loginForm.uuid = res.uuid;
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ export default {
|
|||||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (this.captchaOnOff) {
|
if (this.captchaEnabled) {
|
||||||
this.getCode();
|
this.getCode();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -73,6 +73,17 @@
|
|||||||
v-hasPermi="['monitor:logininfor:remove']"
|
v-hasPermi="['monitor:logininfor:remove']"
|
||||||
>清空</el-button>
|
>清空</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-unlock"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUnlock"
|
||||||
|
v-hasPermi="['monitor:logininfor:unlock']"
|
||||||
|
>解锁</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
@ -118,7 +129,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list, delLogininfor, cleanLogininfor } from "@/api/monitor/logininfor";
|
import { list, delLogininfor, cleanLogininfor, unlockLogininfor } from "@/api/monitor/logininfor";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Logininfor",
|
name: "Logininfor",
|
||||||
@ -129,8 +140,12 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
multiple: true,
|
multiple: true,
|
||||||
|
// 选择用户名
|
||||||
|
selectName: "",
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
@ -180,7 +195,9 @@ export default {
|
|||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.infoId)
|
this.ids = selection.map(item => item.infoId)
|
||||||
|
this.single = selection.length!=1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
|
this.selectName = selection.map(item => item.userName);
|
||||||
},
|
},
|
||||||
/** 排序触发事件 */
|
/** 排序触发事件 */
|
||||||
handleSortChange(column, prop, order) {
|
handleSortChange(column, prop, order) {
|
||||||
@ -207,6 +224,15 @@ export default {
|
|||||||
this.$modal.msgSuccess("清空成功");
|
this.$modal.msgSuccess("清空成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
|
/** 解锁按钮操作 */
|
||||||
|
handleUnlock() {
|
||||||
|
const username = this.selectName;
|
||||||
|
this.$modal.confirm('是否确认解锁用户"' + username + '"数据项?').then(function() {
|
||||||
|
return unlockLogininfor(username);
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess("用户" + username + "解锁成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('monitor/logininfor/export', {
|
this.download('monitor/logininfor/export', {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaOnOff">
|
<el-form-item prop="code" v-if="captchaEnabled">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="registerForm.code"
|
v-model="registerForm.code"
|
||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
@ -104,7 +104,7 @@ export default {
|
|||||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
captchaOnOff: true
|
captchaEnabled: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -113,8 +113,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
getCodeImg().then(res => {
|
getCodeImg().then(res => {
|
||||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
||||||
if (this.captchaOnOff) {
|
if (this.captchaEnabled) {
|
||||||
this.codeUrl = "data:image/gif;base64," + res.img;
|
this.codeUrl = "data:image/gif;base64," + res.img;
|
||||||
this.registerForm.uuid = res.uuid;
|
this.registerForm.uuid = res.uuid;
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ export default {
|
|||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (this.captchaOnOff) {
|
if (this.captchaEnabled) {
|
||||||
this.getCode();
|
this.getCode();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -364,12 +364,14 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.dictCode != undefined) {
|
if (this.form.dictCode != undefined) {
|
||||||
updateData(this.form).then(response => {
|
updateData(this.form).then(response => {
|
||||||
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addData(this.form).then(response => {
|
addData(this.form).then(response => {
|
||||||
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -386,6 +388,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
@ -339,6 +339,7 @@ export default {
|
|||||||
handleRefreshCache() {
|
handleRefreshCache() {
|
||||||
refreshCache().then(() => {
|
refreshCache().then(() => {
|
||||||
this.$modal.msgSuccess("刷新成功");
|
this.$modal.msgSuccess("刷新成功");
|
||||||
|
this.$store.dispatch('dict/cleanDict');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上级菜单">
|
<el-form-item label="上级菜单" prop="parentId">
|
||||||
<treeselect
|
<treeselect
|
||||||
v-model="form.parentId"
|
v-model="form.parentId"
|
||||||
:options="menuOptions"
|
:options="menuOptions"
|
||||||
@ -159,7 +159,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||||
<el-form-item>
|
<el-form-item prop="isFrame">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
|
<el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
@ -195,7 +195,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType != 'M'">
|
<el-col :span="12" v-if="form.menuType != 'M'">
|
||||||
<el-form-item>
|
<el-form-item prop="perms">
|
||||||
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
|
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
|
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
|
||||||
@ -206,7 +206,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||||
<el-form-item>
|
<el-form-item prop="query">
|
||||||
<el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
|
<el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
|
<el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
|
||||||
@ -217,7 +217,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||||
<el-form-item>
|
<el-form-item prop="isCache">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
<el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
@ -231,7 +231,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||||
<el-form-item>
|
<el-form-item prop="visible">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
@ -248,7 +248,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||||
<el-form-item>
|
<el-form-item prop="status">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
|
<el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
|
@ -254,9 +254,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role";
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
|
||||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
||||||
import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Role",
|
name: "Role",
|
||||||
@ -364,12 +363,6 @@ export default {
|
|||||||
this.menuOptions = response.data;
|
this.menuOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 查询部门树结构 */
|
|
||||||
getDeptTreeselect() {
|
|
||||||
deptTreeselect().then(response => {
|
|
||||||
this.deptOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 所有菜单节点数据
|
// 所有菜单节点数据
|
||||||
getMenuAllCheckedKeys() {
|
getMenuAllCheckedKeys() {
|
||||||
// 目前被选中的菜单节点
|
// 目前被选中的菜单节点
|
||||||
@ -396,8 +389,8 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 根据角色ID查询部门树结构 */
|
/** 根据角色ID查询部门树结构 */
|
||||||
getRoleDeptTreeselect(roleId) {
|
getDeptTree(roleId) {
|
||||||
return roleDeptTreeselect(roleId).then(response => {
|
return deptTreeSelect(roleId).then(response => {
|
||||||
this.deptOptions = response.depts;
|
this.deptOptions = response.depts;
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
@ -543,12 +536,12 @@ export default {
|
|||||||
/** 分配数据权限操作 */
|
/** 分配数据权限操作 */
|
||||||
handleDataScope(row) {
|
handleDataScope(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
|
const deptTreeSelect = this.getDeptTree(row.roleId);
|
||||||
getRole(row.roleId).then(response => {
|
getRole(row.roleId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.openDataScope = true;
|
this.openDataScope = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
roleDeptTreeselect.then(res => {
|
deptTreeSelect.then(res => {
|
||||||
this.$refs.dept.setCheckedKeys(res.checkedKeys);
|
this.$refs.dept.setCheckedKeys(res.checkedKeys);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -342,9 +342,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { treeselect } from "@/api/system/dept";
|
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
|
||||||
@ -462,7 +461,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getTreeselect();
|
this.getDeptTree();
|
||||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||||
this.initPassword = response.msg;
|
this.initPassword = response.msg;
|
||||||
});
|
});
|
||||||
@ -479,8 +478,8 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getTreeselect() {
|
getDeptTree() {
|
||||||
treeselect().then(response => {
|
deptTreeSelect().then(response => {
|
||||||
this.deptOptions = response.data;
|
this.deptOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -561,7 +560,6 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
|
||||||
getUser().then(response => {
|
getUser().then(response => {
|
||||||
this.postOptions = response.posts;
|
this.postOptions = response.posts;
|
||||||
this.roleOptions = response.roles;
|
this.roleOptions = response.roles;
|
||||||
@ -573,7 +571,6 @@ export default {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
|
||||||
const userId = row.userId || this.ids;
|
const userId = row.userId || this.ids;
|
||||||
getUser(userId).then(response => {
|
getUser(userId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<userInfo :user="user" />
|
<userInfo :user="user" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="修改密码" name="resetPwd">
|
<el-tab-pane label="修改密码" name="resetPwd">
|
||||||
<resetPwd :user="user" />
|
<resetPwd />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
|
<el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确认密码" prop="confirmPassword">
|
<el-form-item label="确认密码" prop="confirmPassword">
|
||||||
<el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password/>
|
<el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||||
|
@ -233,29 +233,30 @@ insert into sys_menu values('1038', '公告删除', '107', '4', '#', '', '', 1,
|
|||||||
-- 操作日志按钮
|
-- 操作日志按钮
|
||||||
insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1041', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1041', '日志导出', '500', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate(), '', null, '');
|
||||||
-- 登录日志按钮
|
-- 登录日志按钮
|
||||||
insert into sys_menu values('1042', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1042', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1043', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1043', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1044', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1044', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
insert into sys_menu values('1045', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', sysdate(), '', null, '');
|
||||||
-- 在线用户按钮
|
-- 在线用户按钮
|
||||||
insert into sys_menu values('1045', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1046', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1047', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
|
||||||
-- 定时任务按钮
|
-- 定时任务按钮
|
||||||
insert into sys_menu values('1048', '任务查询', '110', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1049', '任务新增', '110', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1050', '任务修改', '110', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1051', '任务删除', '110', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1052', '状态修改', '110', '5', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1053', '任务导出', '110', '7', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1054', '任务导出', '110', '6', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, '');
|
||||||
-- 代码生成按钮
|
-- 代码生成按钮
|
||||||
insert into sys_menu values('1054', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1055', '生成查询', '116', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1055', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1056', '生成修改', '116', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1056', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1057', '生成删除', '116', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1057', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1058', '导入代码', '116', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1058', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1059', '预览代码', '116', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, '');
|
||||||
insert into sys_menu values('1059', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, '');
|
insert into sys_menu values('1060', '生成代码', '116', '6', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@ -372,6 +373,7 @@ insert into sys_role_menu values ('2', '1056');
|
|||||||
insert into sys_role_menu values ('2', '1057');
|
insert into sys_role_menu values ('2', '1057');
|
||||||
insert into sys_role_menu values ('2', '1058');
|
insert into sys_role_menu values ('2', '1058');
|
||||||
insert into sys_role_menu values ('2', '1059');
|
insert into sys_role_menu values ('2', '1059');
|
||||||
|
insert into sys_role_menu values ('2', '1060');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- 8、角色和部门关联表 角色1-N部门
|
-- 8、角色和部门关联表 角色1-N部门
|
||||||
@ -505,17 +507,18 @@ insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_ty
|
|||||||
insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
|
insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
|
||||||
insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||||
insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '关闭状态');
|
insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '关闭状态');
|
||||||
insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新增操作');
|
insert into sys_dict_data values(18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他操作');
|
||||||
insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '修改操作');
|
insert into sys_dict_data values(19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新增操作');
|
||||||
insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '删除操作');
|
insert into sys_dict_data values(20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '修改操作');
|
||||||
insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
|
insert into sys_dict_data values(21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '删除操作');
|
||||||
insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
|
insert into sys_dict_data values(22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
|
||||||
insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
|
insert into sys_dict_data values(23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
|
||||||
insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '强退操作');
|
insert into sys_dict_data values(24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
|
||||||
insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
|
insert into sys_dict_data values(25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '强退操作');
|
||||||
insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '清空操作');
|
insert into sys_dict_data values(26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
|
||||||
insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
|
insert into sys_dict_data values(27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '清空操作');
|
||||||
insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
insert into sys_dict_data values(28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||||
|
insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||||
|
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
@ -539,7 +542,7 @@ create table sys_config (
|
|||||||
insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
|
insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
|
||||||
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
|
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
|
||||||
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
|
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
|
||||||
insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
|
insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
|
||||||
insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
|
insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user