- Replace all encoding/json direct calls with common.Marshal/Unmarshal/DecodeJson per Rule 1 - Fix Dify nil pointer dereference on remote image upload (relay-dify.go) - Fix Claude relay file content type detection for text/* and PDF (relay-claude.go) - Fix unsafe type assertions in Claude relay and Vertex GetModelRegion - Fix StreamScanner unconditionally resetting pre-existing StreamStatus - Add inferMimeTypeFromFilename() for proper MIME type handling in DTO - Fix Mac build script hardcoded DMG version (now reads from tauri.conf.json) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
package setting
|
|
|
|
import (
|
|
"github.com/heicode/manager/common"
|
|
)
|
|
|
|
var Chats = []map[string]string{
|
|
//{
|
|
// "ChatGPT Next Web 官方示例": "https://app.nextchat.dev/#/?settings={\"key\":\"{key}\",\"url\":\"{address}\"}",
|
|
//},
|
|
{
|
|
"Cherry Studio": "cherrystudio://providers/api-keys?v=1&data={cherryConfig}",
|
|
},
|
|
{
|
|
"AionUI": "aionui://provider/add?v=1&data={aionuiConfig}",
|
|
},
|
|
{
|
|
"流畅阅读": "fluentread",
|
|
},
|
|
{
|
|
"CC Switch": "ccswitch",
|
|
},
|
|
{
|
|
"Lobe Chat 官方示例": "https://chat-preview.lobehub.com/?settings={\"keyVaults\":{\"openai\":{\"apiKey\":\"{key}\",\"baseURL\":\"{address}/v1\"}}}",
|
|
},
|
|
{
|
|
"AI as Workspace": "https://aiaw.app/set-provider?provider={\"type\":\"openai\",\"settings\":{\"apiKey\":\"{key}\",\"baseURL\":\"{address}/v1\",\"compatibility\":\"strict\"}}",
|
|
},
|
|
{
|
|
"AMA 问天": "ama://set-api-key?server={address}&key={key}",
|
|
},
|
|
{
|
|
"OpenCat": "opencat://team/join?domain={address}&token={key}",
|
|
},
|
|
}
|
|
|
|
func UpdateChatsByJsonString(jsonString string) error {
|
|
Chats = make([]map[string]string, 0)
|
|
return common.Unmarshal([]byte(jsonString), &Chats)
|
|
}
|
|
|
|
func Chats2JsonString() string {
|
|
jsonBytes, err := common.Marshal(Chats)
|
|
if err != nil {
|
|
common.SysLog("error marshalling chats: " + err.Error())
|
|
return "[]"
|
|
}
|
|
return string(jsonBytes)
|
|
}
|