commit
84bf1b5a34
|
|
@ -77,4 +77,4 @@
|
||||||
|
|
||||||
## 若依交流群
|
## 若依交流群
|
||||||
|
|
||||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) 点击按钮入群。
|
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) [](https://jq.qq.com/?_wv=1027&k=58cPoHA) 点击按钮入群。
|
||||||
|
|
@ -60,6 +60,6 @@ public class SysLoginController extends BaseController
|
||||||
@GetMapping("/unauth")
|
@GetMapping("/unauth")
|
||||||
public String unauth()
|
public String unauth()
|
||||||
{
|
{
|
||||||
return "/error/unauth";
|
return "error/unauth";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,116 +1,144 @@
|
||||||
package com.ruoyi.web.controller.tool;
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
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.utils.StringUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* swagger 测试方法
|
* swagger 用户测试方法
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Api("用户信息管理")
|
@Api("用户信息管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/test/*")
|
@RequestMapping("/test/user")
|
||||||
public class TestController extends BaseController
|
public class TestController extends BaseController
|
||||||
{
|
{
|
||||||
private final static List<Test> testList = new ArrayList<>();
|
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
||||||
{
|
{
|
||||||
testList.add(new Test("1", "admin", "admin123"));
|
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
||||||
testList.add(new Test("2", "ry", "admin123"));
|
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取列表")
|
@ApiOperation("获取用户列表")
|
||||||
@GetMapping("list")
|
@GetMapping("/list")
|
||||||
public List<Test> testList()
|
public AjaxResult userList()
|
||||||
{
|
{
|
||||||
return testList;
|
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||||
|
return AjaxResult.success(userList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取用户详细")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "Integer", paramType = "path")
|
||||||
|
@GetMapping("/{userId}")
|
||||||
|
public AjaxResult getUser(@PathVariable Integer userId)
|
||||||
|
{
|
||||||
|
if (!users.isEmpty() && users.containsKey(userId))
|
||||||
|
{
|
||||||
|
return AjaxResult.success(users.get(userId));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return error("用户不存在");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增用户")
|
@ApiOperation("新增用户")
|
||||||
@PostMapping("save")
|
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
||||||
public AjaxResult save(Test test)
|
@PostMapping("/save")
|
||||||
|
public AjaxResult save(UserEntity user)
|
||||||
{
|
{
|
||||||
return testList.add(test) ? success() : error();
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||||
|
{
|
||||||
|
return error("用户ID不能为空");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("更新用户")
|
@ApiOperation("更新用户")
|
||||||
@ApiImplicitParam(name = "Test", value = "单个用户信息", dataType = "Test")
|
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
|
||||||
@PutMapping("update")
|
@PutMapping("/update")
|
||||||
public AjaxResult update(Test test)
|
public AjaxResult update(UserEntity user)
|
||||||
{
|
{
|
||||||
return testList.remove(test) && testList.add(test) ? success() : error();
|
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||||
|
{
|
||||||
|
return error("用户ID不能为空");
|
||||||
|
}
|
||||||
|
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
||||||
|
{
|
||||||
|
return error("用户不存在");
|
||||||
|
}
|
||||||
|
users.remove(user.getUserId());
|
||||||
|
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除用户")
|
@ApiOperation("删除用户信息")
|
||||||
@ApiImplicitParam(name = "Tests", value = "单个用户信息", dataType = "Test")
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "Integer", paramType = "path")
|
||||||
@DeleteMapping("delete")
|
@DeleteMapping("/{userId}")
|
||||||
public AjaxResult delete(Test test)
|
public AjaxResult delete(@PathVariable Integer userId)
|
||||||
{
|
{
|
||||||
return testList.remove(test) ? success() : error();
|
if (!users.isEmpty() && users.containsKey(userId))
|
||||||
|
{
|
||||||
|
users.remove(userId);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return error("用户不存在");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Test
|
@ApiModel("用户实体")
|
||||||
|
class UserEntity
|
||||||
{
|
{
|
||||||
private String userId;
|
@ApiModelProperty("用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户名称")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
public Test()
|
@ApiModelProperty("用户手机")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
public UserEntity()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Test(String userId, String username, String password)
|
public UserEntity(Integer userId, String username, String password, String mobile)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
|
this.mobile = mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public Integer getUserId()
|
||||||
public boolean equals(Object o)
|
|
||||||
{
|
|
||||||
if (this == o)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Test test = (Test) o;
|
|
||||||
|
|
||||||
return userId != null ? userId.equals(test.userId) : test.userId == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode()
|
|
||||||
{
|
|
||||||
int result = userId != null ? userId.hashCode() : 0;
|
|
||||||
result = 31 * result + (username != null ? username.hashCode() : 0);
|
|
||||||
result = 31 * result + (password != null ? password.hashCode() : 0);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserId()
|
|
||||||
{
|
{
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(String userId)
|
public void setUserId(Integer userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
@ -134,4 +162,14 @@ class Test
|
||||||
{
|
{
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMobile()
|
||||||
|
{
|
||||||
|
return mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile(String mobile)
|
||||||
|
{
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.core.config;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
import springfox.documentation.builders.PathSelectors;
|
import springfox.documentation.builders.PathSelectors;
|
||||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
|
@ -28,11 +29,14 @@ public class SwaggerConfig
|
||||||
public Docket createRestApi()
|
public Docket createRestApi()
|
||||||
{
|
{
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
// 详细定制
|
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
|
// 设置哪些接口暴露给Swagger展示
|
||||||
.select()
|
.select()
|
||||||
// 指定当前包路径
|
// 扫描所有有注解的api,用这种方式更灵活
|
||||||
.apis(RequestHandlerSelectors.basePackage("com.ruoyi.web.controller.tool"))
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
// 扫描指定包中的swagger注解
|
||||||
|
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
||||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||||
.paths(PathSelectors.any())
|
.paths(PathSelectors.any())
|
||||||
.build();
|
.build();
|
||||||
|
|
@ -45,9 +49,13 @@ public class SwaggerConfig
|
||||||
{
|
{
|
||||||
// 用ApiInfoBuilder进行定制
|
// 用ApiInfoBuilder进行定制
|
||||||
return new ApiInfoBuilder()
|
return new ApiInfoBuilder()
|
||||||
|
// 设置标题
|
||||||
.title("标题:若依管理系统_接口文档")
|
.title("标题:若依管理系统_接口文档")
|
||||||
|
// 描述
|
||||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
|
// 作者信息
|
||||||
.contact(new Contact(Global.getName(), null, null))
|
.contact(new Contact(Global.getName(), null, null))
|
||||||
|
// 版本
|
||||||
.version("版本号:" + Global.getVersion())
|
.version("版本号:" + Global.getVersion())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ ruoyi:
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务端口
|
# 服务器的HTTP端口,默认为80
|
||||||
port: 80
|
port: 80
|
||||||
servlet:
|
servlet:
|
||||||
# 项目contextPath
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
tomcat:
|
tomcat:
|
||||||
# tomcat的URI编码
|
# tomcat的URI编码
|
||||||
|
|
@ -49,7 +49,7 @@ spring:
|
||||||
# 资源信息
|
# 资源信息
|
||||||
messages:
|
messages:
|
||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: static/i18n/messages
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
date-format: yyyy-MM-dd HH:mm:ss
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,13 @@
|
||||||
'<tbody style="background-color: #fff;"></tbody>',
|
'<tbody style="background-color: #fff;"></tbody>',
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div>'].join(''));
|
'</div>'].join(''));
|
||||||
|
|
||||||
this.$rightfixedBody.find('table').attr('class', this.$el.attr('class'));
|
this.$rightfixedBody.find('table').attr('class', this.$el.attr('class'));
|
||||||
this.$rightfixedHeaderColumns = this.$rightfixedBody.find('thead');
|
this.$rightfixedHeaderColumns = this.$rightfixedBody.find('thead');
|
||||||
this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody');
|
this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody');
|
||||||
this.$tableBody.before(this.$rightfixedBody);
|
this.$tableBody.before(this.$rightfixedBody);
|
||||||
|
if (this.options.fixedColumns) {
|
||||||
|
$('.right-fixed-table-columns').attr('style','right:0px');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -60,9 +62,9 @@
|
||||||
}
|
}
|
||||||
this.initFixedColumns();
|
this.initFixedColumns();
|
||||||
|
|
||||||
var $ltr = this.$header.find('tr:eq(0)').clone(),
|
var $ltr = this.$header.find('tr:eq(0)').clone(true),
|
||||||
$rtr = this.$header.find('tr:eq(0)').clone(),
|
$rtr = this.$header.find('tr:eq(0)').clone(),
|
||||||
$lths = $ltr.clone().find('th'),
|
$lths = $ltr.clone(true).find('th'),
|
||||||
$rths = $rtr.clone().find('th');
|
$rths = $rtr.clone().find('th');
|
||||||
|
|
||||||
$ltr.html('');
|
$ltr.html('');
|
||||||
|
|
@ -78,7 +80,7 @@
|
||||||
//左边列冻结
|
//左边列冻结
|
||||||
if (this.options.fixedColumns) {
|
if (this.options.fixedColumns) {
|
||||||
for (var i = 0; i < this.options.fixedNumber; i++) {
|
for (var i = 0; i < this.options.fixedNumber; i++) {
|
||||||
$ltr.append($lths.eq(i).clone());
|
$ltr.append($lths.eq(i).clone(true));
|
||||||
}
|
}
|
||||||
this.$fixedHeaderColumns.html('').append($ltr);
|
this.$fixedHeaderColumns.html('').append($ltr);
|
||||||
}
|
}
|
||||||
|
|
@ -95,12 +97,12 @@
|
||||||
if (this.options.fixedColumns) {
|
if (this.options.fixedColumns) {
|
||||||
this.$fixedBodyColumns.html('');
|
this.$fixedBodyColumns.html('');
|
||||||
this.$body.find('> tr[data-index]').each(function () {
|
this.$body.find('> tr[data-index]').each(function () {
|
||||||
var $tr = $(this).clone(),
|
var $tr = $(this).clone(true),
|
||||||
$tds = $tr.clone().find('td');
|
$tds = $tr.clone(true).find('td');
|
||||||
|
|
||||||
$tr.html('');
|
$tr.html('');
|
||||||
for (var i = 0; i < that.options.fixedNumber; i++) {
|
for (var i = 0; i < that.options.fixedNumber; i++) {
|
||||||
$tr.append($tds.eq(i).clone());
|
$tr.append($tds.eq(i).clone(true));
|
||||||
}
|
}
|
||||||
that.$fixedBodyColumns.append($tr);
|
that.$fixedBodyColumns.append($tr);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -384,6 +384,15 @@
|
||||||
_ipt.prop('checked', true);
|
_ipt.prop('checked', true);
|
||||||
target.find("tbody").find("tr").removeClass("treetable-selected");
|
target.find("tbody").find("tr").removeClass("treetable-selected");
|
||||||
$(this).addClass("treetable-selected");
|
$(this).addClass("treetable-selected");
|
||||||
|
} else if (_ipt.attr("type") == "checkbox") {
|
||||||
|
if (_ipt.prop('checked')) {
|
||||||
|
_ipt.prop('checked', true);
|
||||||
|
target.find("tbody").find("tr").removeClass("treetable-selected");
|
||||||
|
$(this).addClass("treetable-selected");
|
||||||
|
} else {
|
||||||
|
_ipt.prop('checked', false);
|
||||||
|
target.find("tbody").find("tr").removeClass("treetable-selected");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (_ipt.prop('checked')) {
|
if (_ipt.prop('checked')) {
|
||||||
_ipt.prop('checked', false);
|
_ipt.prop('checked', false);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ $(document).ready(function(){
|
||||||
//手机号码验证身份证正则合并:(^\d{15}$)|(^\d{17}([0-9]|X)$)
|
//手机号码验证身份证正则合并:(^\d{15}$)|(^\d{17}([0-9]|X)$)
|
||||||
jQuery.validator.addMethod("isPhone",function(value,element){
|
jQuery.validator.addMethod("isPhone",function(value,element){
|
||||||
var length = value.length;
|
var length = value.length;
|
||||||
var phone=/^1[3|4|5|6|7|8][0-9]\d{8}$/;
|
var phone=/^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
||||||
return this.optional(element)||(length == 11 && phone.test(value));
|
return this.optional(element)||(length == 11 && phone.test(value));
|
||||||
},"请填写正确的11位手机号");
|
},"请填写正确的11位手机号");
|
||||||
//电话号码验证
|
//电话号码验证
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 142 KiB |
|
|
@ -0,0 +1,9 @@
|
||||||
|
(function(k){function t(a){a.debug&&(g("callbackIfComplete()"),g("totalFiles: "+a.totalFiles),g("filesLoaded: "+a.filesLoaded));a.async&&a.filesLoaded===a.totalFiles&&a.callback&&a.callback()}function n(a,d){d.debug&&g("loadAndParseFiles");null!==a&&0<a.length?u(a[0],d,function(){a.shift();n(a,d)}):t(d)}function u(a,d,b){d.debug&&(g("loadAndParseFile('"+a+"')"),g("totalFiles: "+d.totalFiles),g("filesLoaded: "+d.filesLoaded));null!==a&&"undefined"!==typeof a&&k.ajax({url:a,async:d.async,cache:d.cache,
|
||||||
|
dataType:"text",success:function(h,c){d.debug&&(g("Succeeded in downloading "+a+"."),g(h));v(h,d);b()},error:function(h,c,e){d.debug&&g("Failed to download or parse "+a+". errorThrown: "+e);404===h.status&&--d.totalFiles;b()}})}function v(a,d){var b="",h=a.split(/\n/),c=/(\{\d+})/g,e=/\{(\d+)}/g,g=/(\\u.{4})/ig;h.forEach(function(a,w){a=a.trim();if(0<a.length&&"#"!=a.match("^#")){var l=a.split("=");if(0<l.length){for(var m=decodeURI(l[0]).trim(),f=1==l.length?"":l[1];"\\"===f.match(/\\$/);)f=f.substring(0,
|
||||||
|
f.length-1),f+=h[++w].trimRight();for(var p=2;p<l.length;p++)f+="="+l[p];f=f.trim();if("map"==d.mode||"both"==d.mode)(l=f.match(g))&&l.forEach(function(a){f=f.replace(a,x(a))}),k.i18n.map[m]=f;if("vars"==d.mode||"both"==d.mode)if(f=f.replace(/"/g,'\\"'),y(m),c.test(f)){var n=!0,q="",r=[];f.split(c).forEach(function(a){!c.test(a)||0!==r.length&&-1!=r.indexOf(a)||(n||(q+=","),q+=a.replace(e,"v$1"),r.push(a),n=!1)});b+=m+"=function("+q+"){";m='"'+f.replace(e,'"+v$1+"')+'"';b+="return "+m+";};"}else b+=
|
||||||
|
m+'="'+f+'";'}}});eval(b);d.filesLoaded+=1}function y(a){if(/\./.test(a)){var d="";a.split(/\./).forEach(function(a,h){0<h&&(d+=".");d+=a;eval("typeof "+d+' == "undefined"')&&eval(d+"={};")})}}function x(a){var d=[];a=parseInt(a.substr(2),16);0<=a&&a<Math.pow(2,16)&&d.push(a);return d.reduce(function(a,d){return a+String.fromCharCode(d)},"")}k.i18n={};k.i18n.map={};var g=function(a){window.console&&console.log("i18n::"+a)};k.i18n.properties=function(a){a=k.extend({name:"Messages",language:"",path:"",
|
||||||
|
mode:"vars",cache:!1,debug:!1,encoding:"UTF-8",async:!1,callback:null},a);a.path.match(/\/$/)||(a.path+="/");a.language=this.normaliseLanguageCode(a.language);var d=a.name&&a.name.constructor===Array?a.name:[a.name];a.totalFiles=2*d.length+(5<=a.language.length?d.length:0);a.debug&&g("totalFiles: "+a.totalFiles);a.filesLoaded=0;d.forEach(function(b){var d=a.path+b+".properties";var c=a.language.substring(0,2);c=a.path+b+"_"+c+".properties";if(5<=a.language.length){var e=a.language.substring(0,5);
|
||||||
|
b=a.path+b+"_"+e+".properties";d=[d,c,b]}else d=[d,c];n(d,a)});a.callback&&!a.async&&a.callback()};k.i18n.prop=function(a){var d,b=k.i18n.map[a];if(null===b)return"["+a+"]";var h;2==arguments.length&&k.isArray(arguments[1])&&(h=arguments[1]);var c;if("string"==typeof b){for(c=0;-1!=(c=b.indexOf("\\",c));)b="t"==b.charAt(c+1)?b.substring(0,c)+"\t"+b.substring(c++ +2):"r"==b.charAt(c+1)?b.substring(0,c)+"\r"+b.substring(c++ +2):"n"==b.charAt(c+1)?b.substring(0,c)+"\n"+b.substring(c++ +2):"f"==b.charAt(c+
|
||||||
|
1)?b.substring(0,c)+"\f"+b.substring(c++ +2):"\\"==b.charAt(c+1)?b.substring(0,c)+"\\"+b.substring(c++ +2):b.substring(0,c)+b.substring(c+1);var e=[];for(c=0;c<b.length;)if("'"==b.charAt(c))if(c==b.length-1)b=b.substring(0,c);else if("'"==b.charAt(c+1))b=b.substring(0,c)+b.substring(++c);else{for(d=c+2;-1!=(d=b.indexOf("'",d));)if(d==b.length-1||"'"!=b.charAt(d+1)){b=b.substring(0,c)+b.substring(c+1,d)+b.substring(d+1);c=d-1;break}else b=b.substring(0,d)+b.substring(++d);-1==d&&(b=b.substring(0,c)+
|
||||||
|
b.substring(c+1))}else if("{"==b.charAt(c))if(d=b.indexOf("}",c+1),-1==d)c++;else{var g=parseInt(b.substring(c+1,d));!isNaN(g)&&0<=g?(c=b.substring(0,c),""!==c&&e.push(c),e.push(g),c=0,b=b.substring(d+1)):c=d+1}else c++;""!==b&&e.push(b);b=e;k.i18n.map[a]=e}if(0===b.length)return"";if(1==b.length&&"string"==typeof b[0])return b[0];e="";c=0;for(d=b.length;c<d;c++)e="string"==typeof b[c]?e+b[c]:h&&b[c]<h.length?e+h[b[c]]:!h&&b[c]+1<arguments.length?e+arguments[b[c]+1]:e+("{"+b[c]+"}");return e};k.i18n.normaliseLanguageCode=
|
||||||
|
function(a){if(!a||2>a.length)a=navigator.languages&&0<navigator.languages.length?navigator.languages[0]:navigator.language||navigator.userLanguage||"en";a=a.toLowerCase();a=a.replace(/-/,"_");3<a.length&&(a=a.substring(0,3)+a.substring(3).toUpperCase());return a}})(jQuery);
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
rightFixedColumns: false,
|
rightFixedColumns: false,
|
||||||
rightFixedNumber: 0,
|
rightFixedNumber: 0,
|
||||||
queryParams: $.table.queryParams,
|
queryParams: $.table.queryParams,
|
||||||
|
rowStyle: {},
|
||||||
};
|
};
|
||||||
var options = $.extend(defaults, options);
|
var options = $.extend(defaults, options);
|
||||||
$.table._option = options;
|
$.table._option = options;
|
||||||
|
|
@ -76,6 +77,7 @@
|
||||||
rightFixedColumns: options.rightFixedColumns, // 是否启用冻结列(右侧)
|
rightFixedColumns: options.rightFixedColumns, // 是否启用冻结列(右侧)
|
||||||
rightFixedNumber: options.rightFixedNumber, // 列冻结的个数(右侧)
|
rightFixedNumber: options.rightFixedNumber, // 列冻结的个数(右侧)
|
||||||
queryParams: options.queryParams, // 传递参数(*)
|
queryParams: options.queryParams, // 传递参数(*)
|
||||||
|
rowStyle: options.rowStyle, // 通过自定义函数设置行样式
|
||||||
columns: options.columns, // 显示列信息(*)
|
columns: options.columns, // 显示列信息(*)
|
||||||
responseHandler: $.table.responseHandler, // 在加载服务器发送来的数据之前处理函数
|
responseHandler: $.table.responseHandler, // 在加载服务器发送来的数据之前处理函数
|
||||||
onLoadSuccess: $.table.onLoadSuccess, // 当所有数据被加载时触发处理函数
|
onLoadSuccess: $.table.onLoadSuccess, // 当所有数据被加载时触发处理函数
|
||||||
|
|
@ -154,10 +156,11 @@
|
||||||
var _value = $.common.nullToStr(value);
|
var _value = $.common.nullToStr(value);
|
||||||
if (_value.length > _length) {
|
if (_value.length > _length) {
|
||||||
_text = _value.substr(0, _length) + "...";
|
_text = _value.substr(0, _length) + "...";
|
||||||
|
return $.common.sprintf("<a href='#' class='tooltip-show' data-toggle='tooltip' title='%s'>%s</a>", _value, _text);
|
||||||
} else {
|
} else {
|
||||||
_text = _value;
|
_text = _value;
|
||||||
|
return _text;
|
||||||
}
|
}
|
||||||
return '<a href="#" class="tooltip-show" data-toggle="tooltip" title="' + _value + '">' + _text +'</a>';
|
|
||||||
},
|
},
|
||||||
// 下拉按钮切换
|
// 下拉按钮切换
|
||||||
dropdownToggle: function (value) {
|
dropdownToggle: function (value) {
|
||||||
|
|
@ -384,6 +387,13 @@
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
$._treeTable.bootstrapTreeTable('refresh');
|
$._treeTable.bootstrapTreeTable('refresh');
|
||||||
},
|
},
|
||||||
|
// 查询表格树指定列值
|
||||||
|
selectColumns: function(column) {
|
||||||
|
var rows = $.map($('#' + $.table._option.id).bootstrapTreeTable('getSelections'), function (row) {
|
||||||
|
return row[column];
|
||||||
|
});
|
||||||
|
return $.common.uniqueFn(rows);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// 表单封装处理
|
// 表单封装处理
|
||||||
form: {
|
form: {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
||||||
</p>
|
</p>
|
||||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <a href="https://jq.qq.com/?_wv=1027&k=5g75dCU" target="_blank">1772718</a>
|
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <s>满1772718</s> <a href="https://jq.qq.com/?_wv=1027&k=5lJkVor" target="_blank">1366522</a>
|
||||||
</p>
|
</p>
|
||||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -681,7 +681,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
请作者喝杯咖啡。
|
请作者喝杯咖啡(点击图片放大)
|
||||||
</div>
|
</div>
|
||||||
<p id="pay-qrcode">
|
<p id="pay-qrcode">
|
||||||
<a href="javascript:;"><img th:src="@{/img/pay.png}" width="100%" alt="请使用手机支付宝或者微信扫码支付">
|
<a href="javascript:;"><img th:src="@{/img/pay.png}" width="100%" alt="请使用手机支付宝或者微信扫码支付">
|
||||||
|
|
@ -695,5 +695,19 @@
|
||||||
</div>
|
</div>
|
||||||
<script th:src="@{/js/jquery.min.js}"></script>
|
<script th:src="@{/js/jquery.min.js}"></script>
|
||||||
<script th:src="@{/js/bootstrap.min.js}"></script>
|
<script th:src="@{/js/bootstrap.min.js}"></script>
|
||||||
|
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#pay-qrcode').click(function(){
|
||||||
|
var html=$(this).html();
|
||||||
|
parent.layer.open({
|
||||||
|
title: false,
|
||||||
|
type: 1,
|
||||||
|
closeBtn:false,
|
||||||
|
shadeClose:true,
|
||||||
|
area: ['600px', 'auto'],
|
||||||
|
content: html
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -8,29 +8,29 @@
|
||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-notice-add">
|
<form class="form-horizontal m" id="form-notice-add">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告标题:</label>
|
<label class="col-sm-2 control-label">公告标题:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<input id="noticeTitle" name="noticeTitle" class="form-control" type="text" required>
|
<input id="noticeTitle" name="noticeTitle" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告类型:</label>
|
<label class="col-sm-2 control-label">公告类型:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
|
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告内容:</label>
|
<label class="col-sm-2 control-label">公告内容:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<input id="noticeContent" name="noticeContent" type="hidden">
|
<input id="noticeContent" name="noticeContent" type="hidden">
|
||||||
<div class="summernote"></div>
|
<div class="summernote"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告状态:</label>
|
<label class="col-sm-2 control-label">公告状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
|
||||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
|
||||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
|
|
@ -45,7 +45,8 @@
|
||||||
var prefix = ctx + "system/notice";
|
var prefix = ctx + "system/notice";
|
||||||
|
|
||||||
$('.summernote').summernote({
|
$('.summernote').summernote({
|
||||||
height : '220px',
|
placeholder: '请输入公告内容',
|
||||||
|
height : 192,
|
||||||
lang : 'zh-CN',
|
lang : 'zh-CN',
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onImageUpload: function (files) {
|
onImageUpload: function (files) {
|
||||||
|
|
|
||||||
|
|
@ -9,29 +9,29 @@
|
||||||
<form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
|
<form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
|
||||||
<input id="noticeId" name="noticeId" th:field="*{noticeId}" type="hidden">
|
<input id="noticeId" name="noticeId" th:field="*{noticeId}" type="hidden">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告标题:</label>
|
<label class="col-sm-2 control-label">公告标题:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text" required>
|
<input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告类型:</label>
|
<label class="col-sm-2 control-label">公告类型:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
|
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{noticeType}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{noticeType}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告内容:</label>
|
<label class="col-sm-2 control-label">公告内容:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
|
<input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
|
||||||
<div id="editor" class="summernote"></div>
|
<div id="editor" class="summernote"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">公告状态:</label>
|
<label class="col-sm-2 control-label">公告状态:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-10">
|
||||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
|
||||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
|
|
@ -47,7 +47,8 @@
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('.summernote').summernote({
|
$('.summernote').summernote({
|
||||||
height : '220px',
|
placeholder: '请输入公告内容',
|
||||||
|
height : 192,
|
||||||
lang : 'zh-CN',
|
lang : 'zh-CN',
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onImageUpload: function (files) {
|
onImageUpload: function (files) {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
|
var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
|
||||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
|
||||||
var prefix = ctx + "system/role";
|
var prefix = ctx + "system/role";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@
|
||||||
var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
|
var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
|
||||||
var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
|
var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
|
||||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
|
||||||
var prefix = ctx + "system/user";
|
var prefix = ctx + "system/user";
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作消息提醒
|
* 操作消息提醒
|
||||||
|
|
@ -85,7 +86,10 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
{
|
{
|
||||||
super.put(CODE_TAG, type.value);
|
super.put(CODE_TAG, type.value);
|
||||||
super.put(MSG_TAG, msg);
|
super.put(MSG_TAG, msg);
|
||||||
super.put(DATA_TAG, data);
|
if (StringUtils.isNotNull(data))
|
||||||
|
{
|
||||||
|
super.put(DATA_TAG, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -98,6 +102,16 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
return AjaxResult.success("操作成功");
|
return AjaxResult.success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回成功数据
|
||||||
|
*
|
||||||
|
* @return 成功消息
|
||||||
|
*/
|
||||||
|
public static AjaxResult success(Object data)
|
||||||
|
{
|
||||||
|
return AjaxResult.success("操作成功", data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功消息
|
* 返回成功消息
|
||||||
*
|
*
|
||||||
|
|
@ -218,11 +232,9 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString()
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
{
|
||||||
.append("code", getCode())
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("code", getCode())
|
||||||
.append("msg", getMsg())
|
.append("msg", getMsg()).append("data", getData()).toString();
|
||||||
.append("data", getData())
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.common.utils;
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,11 +16,11 @@ public class MessageUtils
|
||||||
*
|
*
|
||||||
* @param code 消息键
|
* @param code 消息键
|
||||||
* @param args 参数
|
* @param args 参数
|
||||||
* @return
|
* @return 获取国际化翻译值
|
||||||
*/
|
*/
|
||||||
public static String message(String code, Object... args)
|
public static String message(String code, Object... args)
|
||||||
{
|
{
|
||||||
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
|
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
|
||||||
return messageSource.getMessage(code, args, null);
|
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.framework.shiro.realm.UserRealm;
|
import com.ruoyi.framework.shiro.realm.UserRealm;
|
||||||
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
||||||
import com.ruoyi.framework.shiro.session.OnlineSessionFactory;
|
import com.ruoyi.framework.shiro.session.OnlineSessionFactory;
|
||||||
|
|
@ -47,10 +48,6 @@ public class ShiroConfig
|
||||||
@Value("${shiro.session.expireTime}")
|
@Value("${shiro.session.expireTime}")
|
||||||
private int expireTime;
|
private int expireTime;
|
||||||
|
|
||||||
// 相隔多久检查一次session的有效性,单位毫秒,默认就是10分钟
|
|
||||||
@Value("${shiro.session.validationInterval}")
|
|
||||||
private int validationInterval;
|
|
||||||
|
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
@Value("${shiro.user.captchaEnabled}")
|
@Value("${shiro.user.captchaEnabled}")
|
||||||
private boolean captchaEnabled;
|
private boolean captchaEnabled;
|
||||||
|
|
@ -159,44 +156,6 @@ public class ShiroConfig
|
||||||
return sessionFactory;
|
return sessionFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义sessionFactory调度器
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public SpringSessionValidationScheduler sessionValidationScheduler()
|
|
||||||
{
|
|
||||||
SpringSessionValidationScheduler sessionValidationScheduler = new SpringSessionValidationScheduler();
|
|
||||||
// 相隔多久检查一次session的有效性,单位毫秒,默认就是10分钟
|
|
||||||
sessionValidationScheduler.setSessionValidationInterval(validationInterval * 60 * 1000);
|
|
||||||
// 设置会话验证调度器进行会话验证时的会话管理器
|
|
||||||
sessionValidationScheduler.setSessionManager(sessionValidationManager());
|
|
||||||
return sessionValidationScheduler;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会话管理器
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public OnlineWebSessionManager sessionValidationManager()
|
|
||||||
{
|
|
||||||
OnlineWebSessionManager manager = new OnlineWebSessionManager();
|
|
||||||
// 加入缓存管理器
|
|
||||||
manager.setCacheManager(getEhCacheManager());
|
|
||||||
// 删除过期的session
|
|
||||||
manager.setDeleteInvalidSessions(true);
|
|
||||||
// 设置全局session超时时间
|
|
||||||
manager.setGlobalSessionTimeout(expireTime * 60 * 1000);
|
|
||||||
// 去掉 JSESSIONID
|
|
||||||
manager.setSessionIdUrlRewritingEnabled(false);
|
|
||||||
// 是否定时检查session
|
|
||||||
manager.setSessionValidationSchedulerEnabled(true);
|
|
||||||
// 自定义SessionDao
|
|
||||||
manager.setSessionDAO(sessionDAO());
|
|
||||||
// 自定义sessionFactory
|
|
||||||
manager.setSessionFactory(sessionFactory());
|
|
||||||
return manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话管理器
|
* 会话管理器
|
||||||
*/
|
*/
|
||||||
|
|
@ -213,7 +172,7 @@ public class ShiroConfig
|
||||||
// 去掉 JSESSIONID
|
// 去掉 JSESSIONID
|
||||||
manager.setSessionIdUrlRewritingEnabled(false);
|
manager.setSessionIdUrlRewritingEnabled(false);
|
||||||
// 定义要使用的无效的Session定时调度器
|
// 定义要使用的无效的Session定时调度器
|
||||||
manager.setSessionValidationScheduler(sessionValidationScheduler());
|
manager.setSessionValidationScheduler(SpringUtils.getBean(SpringSessionValidationScheduler.class));
|
||||||
// 是否定时检查session
|
// 是否定时检查session
|
||||||
manager.setSessionValidationSchedulerEnabled(true);
|
manager.setSessionValidationSchedulerEnabled(true);
|
||||||
// 自定义SessionDao
|
// 自定义SessionDao
|
||||||
|
|
@ -227,7 +186,7 @@ public class ShiroConfig
|
||||||
* 安全管理器
|
* 安全管理器
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public SecurityManager securityManager(UserRealm userRealm)
|
public SecurityManager securityManager(UserRealm userRealm, SpringSessionValidationScheduler springSessionValidationScheduler)
|
||||||
{
|
{
|
||||||
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
|
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
|
||||||
// 设置realm.
|
// 设置realm.
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.utils.Threads;
|
import com.ruoyi.common.utils.Threads;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -16,6 +18,7 @@ import com.ruoyi.common.utils.Threads;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class SpringSessionValidationScheduler implements SessionValidationScheduler
|
public class SpringSessionValidationScheduler implements SessionValidationScheduler
|
||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(SpringSessionValidationScheduler.class);
|
private static final Logger log = LoggerFactory.getLogger(SpringSessionValidationScheduler.class);
|
||||||
|
|
@ -32,36 +35,15 @@ public class SpringSessionValidationScheduler implements SessionValidationSchedu
|
||||||
private volatile boolean enabled = false;
|
private volatile boolean enabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The session manager used to validate sessions.
|
* 会话验证管理器
|
||||||
*/
|
*/
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("sessionManager")
|
||||||
private ValidatingSessionManager sessionManager;
|
private ValidatingSessionManager sessionManager;
|
||||||
|
|
||||||
/**
|
// 相隔多久检查一次session的有效性,单位毫秒,默认就是10分钟
|
||||||
* The session validation interval in milliseconds.
|
@Value("${shiro.session.validationInterval}")
|
||||||
*/
|
private long sessionValidationInterval;
|
||||||
private long sessionValidationInterval = DEFAULT_SESSION_VALIDATION_INTERVAL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
public SpringSessionValidationScheduler()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor that specifies the session manager that should be used for validating sessions.
|
|
||||||
*
|
|
||||||
* @param sessionManager the <tt>SessionManager</tt> that should be used to validate sessions.
|
|
||||||
*/
|
|
||||||
public SpringSessionValidationScheduler(ValidatingSessionManager sessionManager)
|
|
||||||
{
|
|
||||||
this.sessionManager = sessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSessionManager(ValidatingSessionManager sessionManager)
|
|
||||||
{
|
|
||||||
this.sessionManager = sessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled()
|
public boolean isEnabled()
|
||||||
|
|
@ -111,7 +93,7 @@ public class SpringSessionValidationScheduler implements SessionValidationSchedu
|
||||||
sessionManager.validateSessions();
|
sessionManager.validateSessions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1000, sessionValidationInterval, TimeUnit.MILLISECONDS);
|
}, 1000, sessionValidationInterval * 60 * 1000, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class GlobalExceptionHandler
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ModelAndView modelAndView = new ModelAndView();
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
modelAndView.setViewName("/error/unauth");
|
modelAndView.setViewName("error/unauth");
|
||||||
return modelAndView;
|
return modelAndView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,12 @@ import java.util.Date;
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.attrType == 'BigDecimal')
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
#break
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${tableComment}表 ${tableName}
|
* ${tableComment}表 ${tableName}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue