optimized code
parent
a606973cbe
commit
356b451b2a
|
@ -54,12 +54,12 @@ public @interface Excel
|
|||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的高度 单位为字符
|
||||
* 导出时在excel中每个列的高度
|
||||
*/
|
||||
public double height() default 14;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的宽 单位为字符
|
||||
* 导出时在excel中每个列的宽度
|
||||
*/
|
||||
public double width() default 16;
|
||||
|
||||
|
@ -109,7 +109,7 @@ public @interface Excel
|
|||
public ColumnType cellType() default ColumnType.STRING;
|
||||
|
||||
/**
|
||||
* 导出列头背景色
|
||||
* 导出列头背景颜色
|
||||
*/
|
||||
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||
|
||||
|
@ -119,7 +119,7 @@ public @interface Excel
|
|||
public IndexedColors headerColor() default IndexedColors.WHITE;
|
||||
|
||||
/**
|
||||
* 导出单元格背景色
|
||||
* 导出单元格背景颜色
|
||||
*/
|
||||
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。
|
||||
*
|
||||
* @return 随机生成的 {@code UUID}
|
||||
*/
|
||||
|
|
|
@ -180,6 +180,16 @@ public class AjaxResult extends HashMap<String, Object>
|
|||
return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为警告消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isWarn()
|
||||
{
|
||||
return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为错误消息
|
||||
*
|
||||
|
@ -187,7 +197,7 @@ public class AjaxResult extends HashMap<String, Object>
|
|||
*/
|
||||
public boolean isError()
|
||||
{
|
||||
return !isSuccess();
|
||||
return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.ruoyi.system.api.domain.SysRole;
|
||||
import com.ruoyi.system.api.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
|
@ -65,7 +66,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
|||
else
|
||||
{
|
||||
List<SysRole> roles = user.getRoles();
|
||||
if (!roles.isEmpty() && roles.size() > 1)
|
||||
if (!CollectionUtils.isEmpty(roles))
|
||||
{
|
||||
// 多角色设置permissions属性,以便数据权限匹配权限
|
||||
for (SysRole role : roles)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 137 KiB |
|
@ -1,4 +1,3 @@
|
|||
import { isArray } from 'util'
|
||||
import { exportDefault, titleCase } from '@/utils/index'
|
||||
import { trigger } from './config'
|
||||
|
||||
|
@ -133,12 +132,12 @@ function buildRules(conf, ruleList) {
|
|||
const rules = []
|
||||
if (trigger[conf.tag]) {
|
||||
if (conf.required) {
|
||||
const type = isArray(conf.defaultValue) ? 'type: \'array\',' : ''
|
||||
let message = isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder
|
||||
const type = Array.isArray(conf.defaultValue) ? 'type: \'array\',' : ''
|
||||
let message = Array.isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder
|
||||
if (message === undefined) message = `${conf.label}不能为空`
|
||||
rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`)
|
||||
}
|
||||
if (conf.regList && isArray(conf.regList)) {
|
||||
if (conf.regList && Array.isArray(conf.regList)) {
|
||||
conf.regList.forEach(item => {
|
||||
if (item.pattern) {
|
||||
rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`)
|
||||
|
|
|
@ -821,7 +821,7 @@
|
|||
</div>
|
||||
<div class="body">
|
||||
<img
|
||||
src="https://oscimg.oschina.net/oscnet/up-d6695f82666e5018f715c41cb7ee60d3b73.png"
|
||||
src="@/assets/images/pay.png"
|
||||
alt="donate"
|
||||
width="100%"
|
||||
/>
|
||||
|
|
|
@ -90,9 +90,7 @@ module.exports = {
|
|||
})
|
||||
.end()
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
config => {
|
||||
config.when(process.env.NODE_ENV !== 'development', config => {
|
||||
config
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
|
@ -101,8 +99,8 @@ module.exports = {
|
|||
inline: /runtime\..*\.js$/
|
||||
}])
|
||||
.end()
|
||||
config
|
||||
.optimization.splitChunks({
|
||||
|
||||
config.optimization.splitChunks({
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
|
@ -113,8 +111,8 @@ module.exports = {
|
|||
},
|
||||
elementUI: {
|
||||
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
|
||||
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
},
|
||||
commons: {
|
||||
name: 'chunk-commons',
|
||||
|
@ -125,12 +123,12 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
config.optimization.runtimeChunk('single'),
|
||||
{
|
||||
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
||||
to: './' //到根目录下
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue