Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
282753dc
authored
Jun 19, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: make the user unable to search token by id
parent
946aa773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
model/token.go
+1
-1
web/src/components/TokensTable.js
+1
-1
No files found.
model/token.go
View file @
282753dc
...
...
@@ -28,7 +28,7 @@ func GetAllUserTokens(userId int, startIdx int, num int) ([]*Token, error) {
}
func
SearchUserTokens
(
userId
int
,
keyword
string
)
(
tokens
[]
*
Token
,
err
error
)
{
err
=
DB
.
Where
(
"user_id = ?"
,
userId
)
.
Where
(
"
id = ? or name LIKE ?"
,
keyword
,
keyword
+
"%"
)
.
Find
(
&
tokens
)
.
Error
err
=
DB
.
Where
(
"user_id = ?"
,
userId
)
.
Where
(
"
name LIKE ?"
,
keyword
+
"%"
)
.
Find
(
&
tokens
)
.
Error
return
tokens
,
err
}
...
...
web/src/components/TokensTable.js
View file @
282753dc
...
...
@@ -154,7 +154,7 @@ const TokensTable = () => {
icon
=
'search'
fluid
iconPosition
=
'left'
placeholder
=
'搜索令牌的
ID 和
名称 ...'
placeholder
=
'搜索令牌的名称 ...'
value
=
{
searchKeyword
}
loading
=
{
searching
}
onChange
=
{
handleKeywordChange
}
...
...
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