Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
61c8a2bc
Commit
61c8a2bc
authored
Jul 05, 2023
by
黄智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整获取角色列表
parent
96d76367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
src/service/system_user.go
src/service/system_user.go
+2
-2
src/util/common.go
src/util/common.go
+9
-0
No files found.
src/service/system_user.go
View file @
61c8a2bc
...
...
@@ -78,9 +78,9 @@ func (o *User) OrgUserRoles(oid string) (interface{}, error) {
}
session
:=
db
.
Table
(
"system_role"
)
.
Where
(
" is_deleted = 0 and state = 1 "
)
if
org
.
DataType
==
2
{
session
.
Where
(
"role_type
<
= 2"
)
session
.
Where
(
"role_type
= 0 or role_type
= 2"
)
}
else
{
session
.
Where
(
"role_type
<
= 1"
)
session
.
Where
(
"role_type
= 0 or role_type
= 1"
)
}
var
roles
[]
entity
.
SystemRole
if
err
:=
session
.
Find
(
&
roles
);
err
!=
nil
{
...
...
src/util/common.go
View file @
61c8a2bc
...
...
@@ -11,6 +11,7 @@ package util
import
(
"net/http"
"regexp"
"strings"
"github.com/Luzifer/go-openssl/v4"
"github.com/google/uuid"
...
...
@@ -58,3 +59,11 @@ func GetUUID() string {
// Creating UUID Version 4
return
uuid
.
New
()
.
String
()
}
func
SpecialEscape
(
keyword
string
)
string
{
keyword
=
strings
.
Replace
(
keyword
,
"
\\
"
,
"
\\\\
"
,
-
1
)
keyword
=
strings
.
Replace
(
keyword
,
"$"
,
"
\\
$"
,
-
1
)
keyword
=
strings
.
Replace
(
keyword
,
"%"
,
"
\\
%"
,
-
1
)
keyword
=
strings
.
Replace
(
keyword
,
"_"
,
"
\\
_"
,
-
1
)
return
keyword
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment