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
c2602989
authored
Jun 21, 2025
by
skynono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: jimeng apiKey format to use `|` delimiter
parent
8e0f1bf4
Hide 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 @
c2602989
...
@@ -77,8 +77,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) {
...
@@ -77,8 +77,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) {
a
.
ChannelType
=
info
.
ChannelType
a
.
ChannelType
=
info
.
ChannelType
a
.
baseURL
=
info
.
BaseUrl
a
.
baseURL
=
info
.
BaseUrl
// apiKey format: "access_key
,
secret_key"
// apiKey format: "access_key
|
secret_key"
keyParts
:=
strings
.
Split
(
info
.
ApiKey
,
"
,
"
)
keyParts
:=
strings
.
Split
(
info
.
ApiKey
,
"
|
"
)
if
len
(
keyParts
)
==
2
{
if
len
(
keyParts
)
==
2
{
a
.
accessKey
=
strings
.
TrimSpace
(
keyParts
[
0
])
a
.
accessKey
=
strings
.
TrimSpace
(
keyParts
[
0
])
a
.
secretKey
=
strings
.
TrimSpace
(
keyParts
[
1
])
a
.
secretKey
=
strings
.
TrimSpace
(
keyParts
[
1
])
...
@@ -192,9 +192,9 @@ func (a *TaskAdaptor) FetchTask(baseUrl, key string, body map[string]any) (*http
...
@@ -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
(
"Accept"
,
"application/json"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
keyParts
:=
strings
.
Split
(
key
,
"
,
"
)
keyParts
:=
strings
.
Split
(
key
,
"
|
"
)
if
len
(
keyParts
)
!=
2
{
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
])
accessKey
:=
strings
.
TrimSpace
(
keyParts
[
0
])
secretKey
:=
strings
.
TrimSpace
(
keyParts
[
1
])
secretKey
:=
strings
.
TrimSpace
(
keyParts
[
1
])
...
...
web/src/pages/Channel/EditChannel.js
View file @
c2602989
...
@@ -67,6 +67,8 @@ function type2secretPrompt(type) {
...
@@ -67,6 +67,8 @@ function type2secretPrompt(type) {
return
'按照如下格式输入:Ak|Sk|Region'
;
return
'按照如下格式输入:Ak|Sk|Region'
;
case
50
:
case
50
:
return
'按照如下格式输入: AccessKey|SecretKey'
;
return
'按照如下格式输入: AccessKey|SecretKey'
;
case
51
:
return
'按照如下格式输入: Access Key ID|Secret Access Key'
;
default
:
default
:
return
'请输入渠道对应的鉴权密钥'
;
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