Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions relay/channel/task/jimeng/adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/Channel/EditChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Comment on lines +70 to +71

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Frontend prompt correctly aligned with backend format.

The new case 51 provides the appropriate user prompt for the pipe-separated API key format, matching the backend expectation. The prompt text is consistent with other similar cases in the function.

Verify that channel type 51 corresponds to the jimeng channel:


🏁 Script executed:

#!/bin/bash
# Description: Verify that channel type 51 is used for jimeng
# Expected: Find confirmation that type 51 maps to jimeng channel

# Search for channel type definitions or mappings
echo "=== Searching for channel type definitions ==="
rg -i "jimeng.*51|51.*jimeng" -A 3 -B 3

# Search for CHANNEL_OPTIONS or similar constants
echo "=== Searching for channel options/types ==="
rg "CHANNEL_OPTIONS|channel.*type" --type js -A 10 -B 5

Length of output: 10597


🏁 Script executed:

#!/bin/bash
echo "=== Searching for ChannelTypeJimeng usage in Go code ==="
rg -n -A3 -B3 'ChannelTypeJimeng' --type go

Length of output: 1027


🏁 Script executed:

#!/bin/bash
echo "=== Extracting type2secretPrompt function ==="
rg -n 'type2secretPrompt' -A15 -B5 web/src/pages/Channel/EditChannel.js

Length of output: 1765


Unify punctuation in type2secretPrompt for consistency

The new prompts for cases 50 and 51 use an ASCII colon and (in case 50) include a space after it, whereas all earlier cases use a Chinese full-width colon () with no space. To keep the UI copy consistent, please update both to use and remove the extra space:

• File: web/src/pages/Channel/EditChannel.js
– Around lines 68–71

   case 50:
-    return '按照如下格式输入: AccessKey|SecretKey';
+    return '按照如下格式输入:AccessKey|SecretKey';
   case 51:
-    return '按照如下格式输入: Access Key ID|Secret Access Key';
+    return '按照如下格式输入:Access Key ID|Secret Access Key';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case 51:
return '按照如下格式输入: Access Key ID|Secret Access Key';
case 50:
return '按照如下格式输入:AccessKey|SecretKey';
case 51:
return '按照如下格式输入:Access Key ID|Secret Access Key';
🤖 Prompt for AI Agents
In web/src/pages/Channel/EditChannel.js around lines 68 to 71, the prompt
strings for cases 50 and 51 use an ASCII colon and inconsistent spacing, while
earlier cases use a Chinese full-width colon without a space. Update these
prompt strings to replace the ASCII colon with a Chinese full-width colon (:)
and remove any extra spaces after the colon to unify punctuation and maintain UI
consistency.

default:
return '请输入渠道对应的鉴权密钥';
}
Expand Down