Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36801e9266 | |||
| 5acd9f08f1 |
29
www/app.js
29
www/app.js
@@ -124,6 +124,19 @@ async function loadBackendConfig() {
|
||||
|
||||
// 不加载默认启用的工具,所有工具默认未启用
|
||||
|
||||
// 将后台系统配置赋值到 CONFIG
|
||||
if (backendConfig.system) {
|
||||
CONFIG.system = backendConfig.system;
|
||||
}
|
||||
|
||||
// 将后台 LLM 配置赋值到 CONFIG
|
||||
if (backendConfig.llm) {
|
||||
CONFIG.apiUrl = backendConfig.llm.api_url;
|
||||
CONFIG.apiKey = backendConfig.llm.api_key;
|
||||
CONFIG.model = backendConfig.llm.model;
|
||||
CONFIG.maxTokens = backendConfig.llm.max_tokens || 2048;
|
||||
}
|
||||
|
||||
updateAgentsDisplay();
|
||||
console.log('后台配置已加载', backendConfig);
|
||||
} catch (e) {
|
||||
@@ -1324,6 +1337,7 @@ function filterDiscoverAgents(keyword) {
|
||||
if (!keyword) {
|
||||
// 显示所有
|
||||
showDiscoverSection('hot', systemAgents.filter(a => a.category === 'hot'));
|
||||
showDiscoverSection('basic', systemAgents.filter(a => a.category === 'basic'));
|
||||
showDiscoverSection('work', systemAgents.filter(a => a.category === 'work'));
|
||||
showDiscoverSection('study', systemAgents.filter(a => a.category === 'study'));
|
||||
showDiscoverSection('life', systemAgents.filter(a => a.category === 'life'));
|
||||
@@ -1338,6 +1352,7 @@ function filterDiscoverAgents(keyword) {
|
||||
|
||||
// 显示搜索结果
|
||||
showDiscoverSection('hot', filtered.filter(a => a.category === 'hot'));
|
||||
showDiscoverSection('basic', filtered.filter(a => a.category === 'basic'));
|
||||
showDiscoverSection('work', filtered.filter(a => a.category === 'work'));
|
||||
showDiscoverSection('study', filtered.filter(a => a.category === 'study'));
|
||||
showDiscoverSection('life', filtered.filter(a => a.category === 'life'));
|
||||
@@ -2611,7 +2626,12 @@ function showAboutPage() {
|
||||
const privacyPolicyBtn = document.getElementById('privacyPolicyBtn');
|
||||
if (privacyPolicyBtn) {
|
||||
privacyPolicyBtn.addEventListener('click', () => {
|
||||
showToast('隐私政策页面待完善');
|
||||
const privacyUrl = CONFIG?.system?.privacyPolicyUrl;
|
||||
if (privacyUrl) {
|
||||
window.open(privacyUrl, '_blank');
|
||||
} else {
|
||||
showToast('隐私政策链接未配置');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2619,7 +2639,12 @@ function showAboutPage() {
|
||||
const userAgreementBtn = document.getElementById('userAgreementBtn');
|
||||
if (userAgreementBtn) {
|
||||
userAgreementBtn.addEventListener('click', () => {
|
||||
showToast('用户协议页面待完善');
|
||||
const agreementUrl = CONFIG?.system?.userAgreementUrl;
|
||||
if (agreementUrl) {
|
||||
window.open(agreementUrl, '_blank');
|
||||
} else {
|
||||
showToast('用户协议链接未配置');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user