Skip to content

Commit fc16c30

Browse files
author
283591387@qq.com
committed
Merge branch 'master' of https://github.com/cq-panda/Vue.NetCore
2 parents c8d1814 + 1ee9cc4 commit fc16c30

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private void CheckUpdateMultiTenancy(string ids, string tableKey)
125125
//例如sql,只能(编辑)自己创建的数据:判断数据是不是当前用户创建的
126126
//sql = $" {sql} and createid!={UserContext.Current.UserId}";
127127
object obj = repository.DapperContext.ExecuteScalar(sql, null);
128-
if (obj == null || obj.GetInt() > 0)
128+
if (obj == null || obj.GetInt()== 0)
129129
{
130130
Response.Error("不能编辑此数据");
131131
}
@@ -143,7 +143,8 @@ private void CheckDelMultiTenancy(string ids, string tableKey)
143143
//例如sql,只能(删除)自己创建的数据:找出不是自己创建的数据
144144
//sql = $" {sql} and createid!={UserContext.Current.UserId}";
145145
object obj = repository.DapperContext.ExecuteScalar(sql, null);
146-
if (obj == null || obj.GetInt() > 0)
146+
int idsCount= ids.Split(",").Distinct().Count();
147+
if (obj == null || obj.GetInt()!= idsCount)
147148
{
148149
Response.Error("不能删除此数据");
149150
}

开发版dev/Vue.NetCore/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private void CheckUpdateMultiTenancy(string ids, string tableKey)
125125
//例如sql,只能(编辑)自己创建的数据:判断数据是不是当前用户创建的
126126
//sql = $" {sql} and createid!={UserContext.Current.UserId}";
127127
object obj = repository.DapperContext.ExecuteScalar(sql, null);
128-
if (obj == null || obj.GetInt() > 0)
128+
if (obj == null || obj.GetInt()== 0)
129129
{
130130
Response.Error("不能编辑此数据");
131131
}
@@ -143,7 +143,8 @@ private void CheckDelMultiTenancy(string ids, string tableKey)
143143
//例如sql,只能(删除)自己创建的数据:找出不是自己创建的数据
144144
//sql = $" {sql} and createid!={UserContext.Current.UserId}";
145145
object obj = repository.DapperContext.ExecuteScalar(sql, null);
146-
if (obj == null || obj.GetInt() > 0)
146+
int idsCount= ids.Split(",").Distinct().Count();
147+
if (obj == null || obj.GetInt()!= idsCount)
147148
{
148149
Response.Error("不能删除此数据");
149150
}

0 commit comments

Comments
 (0)