|
|
@@ -37,7 +37,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, onMounted, nextTick, onUnmounted } from 'vue';
|
|
|
-import { fetchApps } from '../../apis/home';
|
|
|
+import { fetchApps, fetchAppInfo } from '../../apis/home';
|
|
|
import { Message } from '../../3rd-libs/arco-vue-libs';
|
|
|
import Icon from '../../components/Icon/Icon.vue';
|
|
|
import { getConfigField } from '../../config'; // 假设 getConfigField 是从某处导入的
|
|
|
@@ -115,11 +115,16 @@ const selectCategory = (category) => {
|
|
|
filterApps(); // 选择分类后进行筛选
|
|
|
};
|
|
|
|
|
|
-const handleAgentClick = (app) => {
|
|
|
- const iframe_id = app.id;
|
|
|
- const dify_token = access_token.get();
|
|
|
- const workflowUrl = `${baseurl}/app/${iframe_id}/workflow?token=${dify_token}`;
|
|
|
- window.open(workflowUrl, '_blank');
|
|
|
+const handleAgentClick = async (app) => {
|
|
|
+ const appId = app.id;
|
|
|
+ try {
|
|
|
+ const { site } = await fetchAppInfo(appId);
|
|
|
+ const dify_token = access_token.get();
|
|
|
+ const chatUrl = `${baseurl}/chat/${site.code}?token=${dify_token}`;
|
|
|
+ window.open(chatUrl, '_blank');
|
|
|
+ } catch (error) {
|
|
|
+ Message.error('加载数据失败');
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|