Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
9e66ada9
提交
9e66ada9
authored
6月 24, 2023
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化代码
上级
a63eec3b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
77 行增加
和
48 行删除
+77
-48
AjaxResult.java
...rc/main/java/com/ruoyi/common/core/domain/AjaxResult.java
+31
-0
UUID.java
...ommon/src/main/java/com/ruoyi/common/utils/uuid/UUID.java
+1
-1
SysPermissionService.java
...com/ruoyi/framework/web/service/SysPermissionService.java
+2
-1
index.vue
ruoyi-ui/src/components/DictTag/index.vue
+13
-13
js.js
ruoyi-ui/src/utils/generator/js.js
+3
-4
index.vue
ruoyi-ui/src/views/index.vue
+1
-1
vue.config.js
ruoyi-ui/vue.config.js
+26
-28
没有找到文件。
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
浏览文件 @
9e66ada9
package
com
.
ruoyi
.
common
.
core
.
domain
;
import
java.util.HashMap
;
import
java.util.Objects
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.utils.StringUtils
;
...
...
@@ -169,6 +170,36 @@ public class AjaxResult extends HashMap<String, Object>
return
new
AjaxResult
(
code
,
msg
,
null
);
}
/**
* 是否为成功消息
*
* @return 结果
*/
public
boolean
isSuccess
()
{
return
Objects
.
equals
(
HttpStatus
.
SUCCESS
,
this
.
get
(
CODE_TAG
));
}
/**
* 是否为警告消息
*
* @return 结果
*/
public
boolean
isWarn
()
{
return
Objects
.
equals
(
HttpStatus
.
WARN
,
this
.
get
(
CODE_TAG
));
}
/**
* 是否为错误消息
*
* @return 结果
*/
public
boolean
isError
()
{
return
Objects
.
equals
(
HttpStatus
.
ERROR
,
this
.
get
(
CODE_TAG
));
}
/**
* 方便链式调用
*
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java
浏览文件 @
9e66ada9
...
...
@@ -66,7 +66,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
}
/**
* 获取类型 4(伪随机生成的)UUID 的静态工厂。
使用加密的本地线程伪随机数生成器生成该 UUID。
* 获取类型 4(伪随机生成的)UUID 的静态工厂。
*
* @return 随机生成的 {@code UUID}
*/
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
浏览文件 @
9e66ada9
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
java.util.Set
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
com.ruoyi.common.core.domain.entity.SysRole
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.system.service.ISysMenuService
;
...
...
@@ -62,7 +63,7 @@ public class SysPermissionService
else
{
List
<
SysRole
>
roles
=
user
.
getRoles
();
if
(!
roles
.
isEmpty
()
&&
roles
.
size
()
>
1
)
if
(!
CollectionUtils
.
isEmpty
(
roles
)
)
{
// 多角色设置permissions属性,以便数据权限匹配权限
for
(
SysRole
role
:
roles
)
...
...
ruoyi-ui/src/components/DictTag/index.vue
浏览文件 @
9e66ada9
...
...
@@ -7,7 +7,7 @@
:key=
"item.value"
:index=
"index"
:class=
"item.raw.cssClass"
>
{{
item
.
label
+
' '
}}
</span
>
{{
item
.
label
+
" "
}}
</span
>
<el-tag
v-else
...
...
@@ -17,7 +17,7 @@
:type=
"item.raw.listClass == 'primary' ? '' : item.raw.listClass"
:class=
"item.raw.cssClass"
>
{{
item
.
label
+
' '
}}
{{
item
.
label
+
" "
}}
</el-tag>
</
template
>
</template>
...
...
@@ -49,39 +49,39 @@ export default {
},
computed
:
{
values
()
{
if
(
this
.
value
!==
null
&&
typeof
this
.
value
!==
'undefined'
)
{
if
(
this
.
value
!==
null
&&
typeof
this
.
value
!==
"undefined"
)
{
return
Array
.
isArray
(
this
.
value
)
?
this
.
value
:
[
String
(
this
.
value
)];
}
else
{
return
[];
}
},
unmatch
(){
unmatch
()
{
this
.
unmatchArray
=
[];
if
(
this
.
value
!==
null
&&
typeof
this
.
value
!==
'undefined'
)
{
if
(
this
.
value
!==
null
&&
typeof
this
.
value
!==
"undefined"
)
{
// 传入值为非数组
if
(
!
Array
.
isArray
(
this
.
value
))
{
if
(
this
.
options
.
some
(
v
=>
v
.
value
==
this
.
value
))
return
false
;
if
(
!
Array
.
isArray
(
this
.
value
))
{
if
(
this
.
options
.
some
((
v
)
=>
v
.
value
==
this
.
value
))
return
false
;
this
.
unmatchArray
.
push
(
this
.
value
);
return
true
;
}
// 传入值为Array
this
.
value
.
forEach
(
item
=>
{
if
(
!
this
.
options
.
some
(
v
=>
v
.
value
==
item
))
this
.
unmatchArray
.
push
(
item
)
this
.
value
.
forEach
((
item
)
=>
{
if
(
!
this
.
options
.
some
((
v
)
=>
v
.
value
==
item
))
this
.
unmatchArray
.
push
(
item
);
});
return
true
;
}
// 没有value不显示
return
false
;
},
},
filters
:
{
handleArray
(
array
)
{
if
(
array
.
length
===
0
)
return
''
;
if
(
array
.
length
===
0
)
return
""
;
return
array
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
' '
+
cur
;
return
pre
+
" "
+
cur
;
})
}
,
}
}
};
</
script
>
...
...
ruoyi-ui/src/utils/generator/js.js
浏览文件 @
9e66ada9
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
]}
' }`
)
...
...
ruoyi-ui/src/views/index.vue
浏览文件 @
9e66ada9
...
...
@@ -888,7 +888,7 @@
</div>
<div
class=
"body"
>
<img
src=
"http
s://oscimg.oschina.net/oscnet/up-d6695f82666e5018f715c41cb7ee60d3b73
.png"
src=
"http
://ruoyi.vip/images/pay
.png"
alt=
"donate"
width=
"100%"
/>
...
...
ruoyi-ui/vue.config.js
浏览文件 @
9e66ada9
...
...
@@ -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,36 +99,36 @@ module.exports = {
inline
:
/runtime
\.
.*
\.
js$/
}])
.
end
()
config
.
optimization
.
splitChunks
({
chunks
:
'all'
,
cacheGroups
:
{
libs
:
{
name
:
'chunk-libs'
,
test
:
/
[\\/]
node_modules
[\\/]
/
,
priority
:
10
,
chunks
:
'initial'
// only package third parties that are initially dependent
},
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
},
commons
:
{
name
:
'chunk-commons'
,
test
:
resolve
(
'src/components'
),
// can customize your rules
minChunks
:
3
,
// minimum common number
priority
:
5
,
reuseExistingChunk
:
true
}
config
.
optimization
.
splitChunks
({
chunks
:
'all'
,
cacheGroups
:
{
libs
:
{
name
:
'chunk-libs'
,
test
:
/
[\\/]
node_modules
[\\/]
/
,
priority
:
10
,
chunks
:
'initial'
// only package third parties that are initially dependent
},
elementUI
:
{
name
:
'chunk-elementUI'
,
// split elementUI into a single package
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'
,
test
:
resolve
(
'src/components'
),
// can customize your rules
minChunks
:
3
,
// minimum common number
priority
:
5
,
reuseExistingChunk
:
true
}
})
}
})
config
.
optimization
.
runtimeChunk
(
'single'
),
{
from
:
path
.
resolve
(
__dirname
,
'./public/robots.txt'
),
//防爬虫文件
to
:
'./'
//到根目录下
}
}
)
})
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论