feat: add DeepChat deeplink support (#4668)
This commit is contained in:
+5
-1
@@ -251,7 +251,11 @@ const SiderBar = ({ onNavigate = () => {} }) => {
|
||||
for (let key in chats[i]) {
|
||||
let link = chats[i][key];
|
||||
if (typeof link !== 'string') continue; // 确保链接是字符串
|
||||
if (link.startsWith('fluent') || link.startsWith('ccswitch')) {
|
||||
if (
|
||||
link.startsWith('fluent') ||
|
||||
link.startsWith('ccswitch') ||
|
||||
link.startsWith('deepchat')
|
||||
) {
|
||||
shouldSkip = true;
|
||||
break;
|
||||
}
|
||||
|
||||
+10
@@ -251,6 +251,16 @@ export const useTokensData = (openFluentNotification, openCCSwitchModal) => {
|
||||
encodeToBase64(JSON.stringify(aionuiConfig)),
|
||||
);
|
||||
url = url.replaceAll('{aionuiConfig}', encodedConfig);
|
||||
} else if (url.includes('{deepchatConfig}') === true) {
|
||||
let deepchatConfig = {
|
||||
id: 'new-api',
|
||||
baseUrl: serverAddress,
|
||||
apiKey: `sk-${fullKey}`,
|
||||
};
|
||||
let encodedConfig = encodeURIComponent(
|
||||
encodeToBase64(JSON.stringify(deepchatConfig)),
|
||||
);
|
||||
url = url.replaceAll('{deepchatConfig}', encodedConfig);
|
||||
} else {
|
||||
let encodedServerAddress = encodeURIComponent(serverAddress);
|
||||
url = url.replaceAll('{address}', encodedServerAddress);
|
||||
|
||||
@@ -71,6 +71,7 @@ export default function SettingsChats(props) {
|
||||
{ name: 'AionUI', url: 'aionui://provider/add?v=1&data={aionuiConfig}' },
|
||||
{ name: '流畅阅读', url: 'fluentread' },
|
||||
{ name: 'CC Switch', url: 'ccswitch' },
|
||||
{ name: 'DeepChat', url: 'deepchat://provider/install?v=1&data={deepchatConfig}' },
|
||||
{ name: 'Lobe Chat', url: 'https://chat-preview.lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"{key}","baseURL":"{address}/v1"}}}' },
|
||||
{ name: 'AI as Workspace', url: 'https://aiaw.app/set-provider?provider={"type":"openai","settings":{"apiKey":"{key}","baseURL":"{address}/v1","compatibility":"strict"}}' },
|
||||
{ name: 'AMA 问天', url: 'ama://set-api-key?server={address}&key={key}' },
|
||||
|
||||
Reference in New Issue
Block a user