mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-29 04:51:58 +08:00
Compare commits
3 Commits
65daf44885
...
5d6255cfaa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d6255cfaa | ||
|
|
bbd112d5a3 | ||
|
|
6fb42d117e |
@@ -113,9 +113,10 @@ public class DataScopeAspect
|
||||
}
|
||||
if (DATA_SCOPE_ALL.equals(dataScope))
|
||||
{
|
||||
// 全部数据权限,不添加额外条件
|
||||
sqlString = new StringBuilder();
|
||||
conditions.add(dataScope);
|
||||
break;
|
||||
conditions.clear();
|
||||
return;
|
||||
}
|
||||
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
|
||||
{
|
||||
@@ -143,28 +144,28 @@ public class DataScopeAspect
|
||||
{
|
||||
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 数据权限为仅本人且没有userAlias别名不查询任何数据
|
||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
||||
}
|
||||
// 当没有 userAlias 时,不添加任何条件
|
||||
}
|
||||
conditions.add(dataScope);
|
||||
}
|
||||
|
||||
// 角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据
|
||||
// 角色都不包含传递过来的权限字符,这个时候不添加任何条件
|
||||
if (StringUtils.isEmpty(conditions))
|
||||
{
|
||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
||||
sqlString = new StringBuilder();
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
||||
String sql = sqlString.toString().trim();
|
||||
if (sql.startsWith("OR ")) {
|
||||
sql = sql.substring(3);
|
||||
}
|
||||
if (StringUtils.isNotBlank(sql))
|
||||
{
|
||||
Object params = joinPoint.getArgs()[0];
|
||||
if (StringUtils.isNotNull(params) && params instanceof BaseEntity)
|
||||
if (params instanceof BaseEntity)
|
||||
{
|
||||
BaseEntity baseEntity = (BaseEntity) params;
|
||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sql + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,4 +182,4 @@ public class DataScopeAspect
|
||||
baseEntity.getParams().put(DATA_SCOPE, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:file-list="fileList"
|
||||
:data="data"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
@@ -48,6 +49,15 @@ export default {
|
||||
props: {
|
||||
// 值
|
||||
value: [String, Object, Array],
|
||||
// 上传接口地址
|
||||
action: {
|
||||
type: String,
|
||||
default: "/file/upload"
|
||||
},
|
||||
// 上传携带的参数
|
||||
data: {
|
||||
type: Object
|
||||
},
|
||||
// 数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
@@ -78,7 +88,7 @@ export default {
|
||||
return {
|
||||
number: 0,
|
||||
uploadList: [],
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传文件服务器地址
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + this.action, // 上传文件服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
@@ -152,7 +162,7 @@ export default {
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.$modal.msgError("上传文件失败,请重试");
|
||||
this.$modal.closeLoading()
|
||||
this.$modal.closeLoading();
|
||||
},
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
list-type="picture-card"
|
||||
:on-success="handleUploadSuccess"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:data="data"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
@@ -48,6 +49,15 @@ import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
props: {
|
||||
value: [String, Object, Array],
|
||||
// 上传接口地址
|
||||
action: {
|
||||
type: String,
|
||||
default: "/file/upload"
|
||||
},
|
||||
// 上传携带的参数
|
||||
data: {
|
||||
type: Object
|
||||
},
|
||||
// 图片数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
@@ -76,7 +86,7 @@ export default {
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
hideUpload: false,
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + this.action, // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user