!41 发布 v2.2.0

Merge pull request !41 from 疯狂的狮子li/dev
This commit is contained in:
疯狂的狮子li 2021-05-25 14:18:21 +08:00 committed by Gitee
commit 9bd78a8c22
40 changed files with 677 additions and 569 deletions

View File

@ -41,13 +41,18 @@
### 其他
* 同步升级 RuoYi-Vue 3.4.0
* 同步升级 RuoYi-Vue 3.5.0
* 单模块 fast 分支 [RuoYi-Vue-Plus-fast](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/fast/)
## 关注作者(扫码请备注: "加群")
![](https://images.gitee.com/uploads/images/2021/0508/235345_5503356a_1766278.jpeg)
## 捐献作者
作者为兼职做开源,平时还需要工作,如果帮到了您可以请作者吃个盒饭
<img src="https://images.gitee.com/uploads/images/2021/0525/101654_451e4523_1766278.jpeg" width="300px" height="450px" />
<img src="https://images.gitee.com/uploads/images/2021/0525/101713_3d18b119_1766278.jpeg" width="300px" height="450px" />
## 重点注意事项
若依文档对事务注解的描述 [关于事务](https://doc.ruoyi.vip/ruoyi/document/htsc.html#%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86) 以下对多数据源事务做补充:

10
pom.xml
View File

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-vue-plus</artifactId>
@ -13,21 +13,21 @@
<description>RuoYi-Vue-Plus后台管理系统</description>
<properties>
<ruoyi-vue-plus.version>2.1.2</ruoyi-vue-plus.version>
<ruoyi-vue-plus.version>2.2.0</ruoyi-vue-plus.version>
<spring-boot.version>2.3.11.RELEASE</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.4</druid.version>
<druid.version>1.2.6</druid.version>
<knife4j.version>3.0.2</knife4j.version>
<swagger-annotations.version>1.5.22</swagger-annotations.version>
<fastjson.version>1.2.75</fastjson.version>
<fastjson.version>1.2.76</fastjson.version>
<poi.version>4.1.2</poi.version>
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version>
<mybatis-plus.version>3.4.3</mybatis-plus.version>
<hutool.version>5.5.8</hutool.version>
<hutool.version>5.6.5</hutool.version>
<feign.version>2.2.6.RELEASE</feign.version>
<feign-okhttp.version>11.0</feign-okhttp.version>
<spring-boot-admin.version>2.3.1</spring-boot-admin.version>

View File

@ -52,6 +52,12 @@ public class CaptchaController {
*/
@GetMapping("/captchaImage")
public AjaxResult getCode() {
Map<String, Object> ajax = new HashMap<>();
Boolean enabled = captchaProperties.getEnabled();
ajax.put("enabled", enabled);
if (!enabled) {
return AjaxResult.success(ajax);
}
// 保存验证码信息
String uuid = IdUtil.simpleUUID();
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
@ -90,7 +96,6 @@ public class CaptchaController {
code = captcha.getCode();
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
Map<String,Object> ajax = new HashMap<>();
ajax.put("uuid", uuid);
ajax.put("img", captcha.getImageBase64());
return AjaxResult.success(ajax);

View File

@ -1,3 +1,7 @@
---
server:
port: 8081
---
# 数据源配置
spring:
datasource:
@ -6,9 +10,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: root
password: root
url: jdbc:mysql://39.101.143.184:3306/ruoyi-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: ruoyi-vue
password: ryvue
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -58,13 +62,13 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 39.101.143.184
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
password: ryvue
# 连接超时时间
timeout: 10s
lettuce:

View File

@ -14,6 +14,8 @@ ruoyi:
addressEnabled: false
captcha:
# 验证码开关
enabled: true
# 验证码类型 math 数组计算 char 字符验证
type: math
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰

View File

@ -81,6 +81,7 @@ public class LoginUser implements UserDetails
return user.getPassword();
}
@JsonIgnore
@Override
public String getUsername()
{
@ -133,6 +134,7 @@ public class LoginUser implements UserDetails
return true;
}
@JsonIgnore
@Override
public Collection<? extends GrantedAuthority> getAuthorities()
{

View File

@ -1,6 +1,7 @@
package com.ruoyi.common.filter;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
import org.apache.commons.io.IOUtils;
import org.springframework.http.HttpHeaders;
@ -100,6 +101,6 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
public boolean isJsonRequest()
{
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header);
return StrUtil.startWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.framework.aspectj;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.annotation.Log;
@ -198,7 +199,7 @@ public class LogAspect
{
for (int i = 0; i < paramsArray.length; i++)
{
if (!isFilterObject(paramsArray[i]))
if (Validator.isNotNull(paramsArray[i]) && !isFilterObject(paramsArray[i]))
{
Object jsonObj = JSON.toJSON(paramsArray[i]);
params += jsonObj.toString() + " ";

View File

@ -1,71 +0,0 @@
package com.ruoyi.framework.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;
import com.alibaba.fastjson.parser.ParserConfig;
import org.springframework.util.Assert;
import java.nio.charset.Charset;
/**
* Redis使用FastJson序列化
*
* @author ruoyi
*/
public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
{
@SuppressWarnings("unused")
private ObjectMapper objectMapper = new ObjectMapper();
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
private Class<T> clazz;
static
{
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
}
public FastJson2JsonRedisSerializer(Class<T> clazz)
{
super();
this.clazz = clazz;
}
@Override
public byte[] serialize(T t) throws SerializationException
{
if (t == null)
{
return new byte[0];
}
return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
}
@Override
public T deserialize(byte[] bytes) throws SerializationException
{
if (bytes == null || bytes.length <= 0)
{
return null;
}
String str = new String(bytes, DEFAULT_CHARSET);
return JSON.parseObject(str, clazz);
}
public void setObjectMapper(ObjectMapper objectMapper)
{
Assert.notNull(objectMapper, "'objectMapper' must not be null");
this.objectMapper = objectMapper;
}
protected JavaType getJavaType(Class<?> clazz)
{
return TypeFactory.defaultInstance().constructType(clazz);
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.framework.config;
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
@ -7,11 +8,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
/**
* redis配置
@ -29,16 +25,17 @@ public class RedisConfig extends CachingConfigurerSupport
RedisTemplate<Object, Object> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);
FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
GenericFastJsonRedisSerializer serializer = new GenericFastJsonRedisSerializer();
StringRedisSerializer keySerializer = new StringRedisSerializer();
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
serializer.setObjectMapper(mapper);
template.setValueSerializer(serializer);
// 使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
template.setKeySerializer(keySerializer);
template.setValueSerializer(serializer);
// Hash的key也采用StringRedisSerializer的序列化方式
template.setHashKeySerializer(keySerializer);
template.setHashValueSerializer(serializer);
template.afterPropertiesSet();
return template;
}

View File

@ -13,12 +13,29 @@ import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "captcha")
public class CaptchaProperties {
// 验证码类型
/**
* 验证码开关
*/
private Boolean enabled;
/**
* 验证码类型
*/
private String type;
// 验证码类别
/**
* 验证码类别
*/
private String category;
// 数字验证码位数
/**
* 数字验证码位数
*/
private Integer numberLength;
// 字符验证码长度
/**
* 字符验证码长度
*/
private Integer charLength;
}

View File

@ -1,22 +1,29 @@
package com.ruoyi.framework.web.service;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.config.properties.CaptchaProperties;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 登录校验方法
@ -35,6 +42,12 @@ public class SysLoginService
@Autowired
private RedisCache redisCache;
@Autowired
private CaptchaProperties captchaProperties;
@Autowired
private ISysUserService userService;
/**
* 登录验证
*
@ -46,19 +59,19 @@ public class SysLoginService
*/
public String login(String username, String password, String code, String uuid)
{
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
if(captchaProperties.getEnabled()) {
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
}
// 用户验证
Authentication authentication = null;
try
@ -82,7 +95,19 @@ public class SysLoginService
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
recordLoginInfo(loginUser.getUser());
// 生成token
return tokenService.createToken(loginUser);
}
/**
* 记录登录信息
*/
public void recordLoginInfo(SysUser user)
{
user.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
user.setLoginDate(DateUtils.getNowDate());
user.setUpdateBy(user.getUserName());
userService.updateUserProfile(user);
}
}

View File

@ -143,6 +143,7 @@ public class GenTableServiceImpl extends ServiceImpl<GenTableMapper, GenTable> i
.set(cenTableColumn.getIsEdit() == null, GenTableColumn::getIsEdit, null)
.set(cenTableColumn.getIsList() == null, GenTableColumn::getIsList, null)
.set(cenTableColumn.getIsQuery() == null, GenTableColumn::getIsQuery, null)
.set(cenTableColumn.getIsRequired() == null, GenTableColumn::getIsRequired, null)
.eq(GenTableColumn::getColumnId,cenTableColumn.getColumnId()));
}
}

View File

@ -29,10 +29,12 @@ public class ${ClassName}AddBo {
#if($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
#end
#if($column.isRequired==1)
#if($column.javaType == 'String')
@NotBlank(message = "$column.columnComment不能为空")
#else
@NotNull(message = "$column.columnComment不能为空")
#end
#end
private $column.javaType $column.javaField;
#end

View File

@ -29,10 +29,12 @@ public class ${ClassName}EditBo {
#if($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
#end
#if($column.isRequired==1)
#if($column.javaType == 'String')
@NotBlank(message = "$column.columnComment不能为空")
#else
@NotNull(message = "$column.columnComment不能为空")
#end
#end
private $column.javaType $column.javaField;
#end

View File

@ -108,6 +108,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['${moduleName}:${businessName}:export']"
>导出</el-button>
@ -354,6 +355,8 @@ export default {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
#if($table.sub)
@ -630,10 +633,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return export${BusinessName}(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -23,11 +23,6 @@
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,6 +1,6 @@
{
"name": "ruoyi-vue-plus",
"version": "2.1.2",
"version": "2.2.0",
"description": "RuoYi-Vue-Plus后台管理系统",
"author": "LionLi",
"license": "MIT",

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
body,

View File

@ -80,7 +80,21 @@
<span>更新日志</span>
</div>
<el-collapse accordion>
<el-collapse-item title="v2.1.1 - 2021-5-21">
<el-collapse-item title="v2.2.0 - 2021-5-25">
<ol>
<li>同步升级 RuoYi-Vue 3.5.0</li>
<li>add 增加验证码开关</li>
<li>add 新增IE浏览器版本过低提示页面</li>
<li>update 升级druid到最新版本v1.2.6</li>
<li>update 升级fastjson到最新版1.2.76</li>
<li>update 修改bo加入判断是否设置必填再加载必填注解</li>
<li>update 生成vue模板导出按钮点击后添加遮罩</li>
<li>update Redis设置HashKey序列化</li>
<li>update 优化Redis序列化配置</li>
<li>fix 修复代码生成器中表字段取消必填无法更新问题</li>
</ol>
</el-collapse-item>
<el-collapse-item title="v2.1.2 - 2021-5-21">
<ol>
<li>update springboot 升级 2.3.11</li>
<li>update mybatis-plus 升级 3.4.3 分页Plus对象适配更新</li>
@ -166,7 +180,7 @@ export default {
data() {
return {
//
version: "2.1.0",
version: "2.2.0",
};
},
methods: {

View File

@ -18,7 +18,7 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
auto-complete="off"
@ -81,7 +81,8 @@ export default {
code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
},
loading: false,
redirect: undefined
redirect: undefined,
captchaEnabled:false
};
},
watch: {
@ -99,8 +100,11 @@ export default {
methods: {
getCode() {
getCodeImg().then(res => {
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.loginForm.uuid = res.data.uuid;
this.captchaEnabled = res.data.enabled;
if(res.data.enabled){
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.loginForm.uuid = res.data.uuid;
}
});
},
getCookie() {

View File

@ -75,6 +75,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['monitor:job:export']"
>导出</el-button>
@ -274,6 +275,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -477,10 +480,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportJob(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -89,6 +89,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['monitor:job:export']"
>导出</el-button>
@ -175,6 +176,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -288,10 +291,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportJobLog(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -83,6 +83,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['monitor:logininfor:export']"
>导出</el-button>
@ -126,6 +127,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -221,10 +224,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportLogininfor(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -99,6 +99,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['monitor:operlog:export']"
>导出</el-button>
@ -195,6 +196,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -309,10 +312,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportOperlog(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -88,6 +88,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:config:export']"
>导出</el-button>
@ -188,6 +189,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -344,10 +347,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportConfig(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
},
/** 清理缓存按钮操作 */

View File

@ -75,6 +75,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
@ -169,6 +170,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -343,10 +346,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportData(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -94,6 +94,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
@ -196,6 +197,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -348,10 +351,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportType(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
},
/** 清理缓存按钮操作 */

View File

@ -176,7 +176,7 @@
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import Editor from '@/components/Editor';
export default {

View File

@ -74,6 +74,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:post:export']"
>导出</el-button>
@ -163,6 +164,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -315,10 +318,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportPost(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -94,6 +94,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:role:export']"
>导出</el-button>
@ -258,6 +259,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -599,10 +602,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportRole(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
}
}

View File

@ -131,6 +131,7 @@
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:user:export']"
>导出</el-button>
@ -356,6 +357,8 @@ export default {
return {
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
@ -637,10 +640,12 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.exportLoading = true;
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
})
},
/** 导入按钮操作 */