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
7b936283
authored
Jul 17, 2025
by
Calcium-Ion
Committed by
GitHub
Jul 17, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1387 from feitianbubu/alpha
fix: playground chat
parents
082e5717
79522d76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
controller/playground.go
+2
-3
middleware/auth.go
+12
-0
No files found.
controller/playground.go
View file @
7b936283
...
@@ -65,9 +65,8 @@ func Playground(c *gin.Context) {
...
@@ -65,9 +65,8 @@ func Playground(c *gin.Context) {
Group
:
group
,
Group
:
group
,
}
}
_
=
middleware
.
SetupContextForToken
(
c
,
tempToken
)
_
=
middleware
.
SetupContextForToken
(
c
,
tempToken
)
_
,
err
=
getChannel
(
c
,
group
,
playgroundRequest
.
Model
,
0
)
_
,
newAPIError
=
getChannel
(
c
,
group
,
playgroundRequest
.
Model
,
1
)
if
err
!=
nil
{
if
newAPIError
!=
nil
{
newAPIError
=
types
.
NewError
(
err
,
types
.
ErrorCodeGetChannelFailed
)
return
return
}
}
//middleware.SetupContextForSelectedChannel(c, channel, playgroundRequest.Model)
//middleware.SetupContextForSelectedChannel(c, channel, playgroundRequest.Model)
...
...
middleware/auth.go
View file @
7b936283
...
@@ -123,6 +123,18 @@ func authHelper(c *gin.Context, minRole int) {
...
@@ -123,6 +123,18 @@ func authHelper(c *gin.Context, minRole int) {
c
.
Set
(
"id"
,
id
)
c
.
Set
(
"id"
,
id
)
c
.
Set
(
"group"
,
session
.
Get
(
"group"
))
c
.
Set
(
"group"
,
session
.
Get
(
"group"
))
c
.
Set
(
"use_access_token"
,
useAccessToken
)
c
.
Set
(
"use_access_token"
,
useAccessToken
)
userCache
,
err
:=
model
.
GetUserCache
(
id
.
(
int
))
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
err
.
Error
(),
})
c
.
Abort
()
return
}
userCache
.
WriteContext
(
c
)
c
.
Next
()
c
.
Next
()
}
}
...
...
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