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
ffaf60df
authored
Jul 01, 2025
by
Calcium-Ion
Committed by
GitHub
Jul 01, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1322 from feitianbubu/pr/jimeng-key-delimiter
feat: jimeng apiKey format to use `|` delimiter
parents
8e0f1bf4
c2602989
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
relay/channel/task/jimeng/adaptor.go
+4
-4
web/src/pages/Channel/EditChannel.js
+2
-0
No files found.
relay/channel/task/jimeng/adaptor.go
View file @
ffaf60df
...
...
@@ -77,8 +77,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) {
a
.
ChannelType
=
info
.
ChannelType
a
.
baseURL
=
info
.
BaseUrl
// apiKey format: "access_key
,
secret_key"
keyParts
:=
strings
.
Split
(
info
.
ApiKey
,
"
,
"
)
// apiKey format: "access_key
|
secret_key"
keyParts
:=
strings
.
Split
(
info
.
ApiKey
,
"
|
"
)
if
len
(
keyParts
)
==
2
{
a
.
accessKey
=
strings
.
TrimSpace
(
keyParts
[
0
])
a
.
secretKey
=
strings
.
TrimSpace
(
keyParts
[
1
])
...
...
@@ -192,9 +192,9 @@ func (a *TaskAdaptor) FetchTask(baseUrl, key string, body map[string]any) (*http
req
.
Header
.
Set
(
"Accept"
,
"application/json"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
keyParts
:=
strings
.
Split
(
key
,
"
,
"
)
keyParts
:=
strings
.
Split
(
key
,
"
|
"
)
if
len
(
keyParts
)
!=
2
{
return
nil
,
fmt
.
Errorf
(
"invalid api key format for jimeng: expected 'ak
,
sk'"
)
return
nil
,
fmt
.
Errorf
(
"invalid api key format for jimeng: expected 'ak
|
sk'"
)
}
accessKey
:=
strings
.
TrimSpace
(
keyParts
[
0
])
secretKey
:=
strings
.
TrimSpace
(
keyParts
[
1
])
...
...
web/src/pages/Channel/EditChannel.js
View file @
ffaf60df
...
...
@@ -67,6 +67,8 @@ function type2secretPrompt(type) {
return
'按照如下格式输入:Ak|Sk|Region'
;
case
50
:
return
'按照如下格式输入: AccessKey|SecretKey'
;
case
51
:
return
'按照如下格式输入: Access Key ID|Secret Access Key'
;
default
:
return
'请输入渠道对应的鉴权密钥'
;
}
...
...
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