diff --git a/portal-ui/src/api/ai.js b/portal-ui/src/api/ai.js new file mode 100644 index 0000000..12ace33 --- /dev/null +++ b/portal-ui/src/api/ai.js @@ -0,0 +1,41 @@ +import request from '@/utils/request' + +/** + * AI生成相关API + * 符合 vue-api-calling.mdc 规范 + */ + +export function generateImage(data) { + return request({ + url: '/api/ai/promptToImg', + method: 'post', + data: data + }) +} + +export function imgToImg(data) { + return request({ + url: '/api/ai/imgToImg', + method: 'post', + data: data + }) +} + +export function getAiManagerInfo(type) { + return request({ + url: '/api/manager/selectInfo', + method: 'get', + params: { type } + }) +} + +export function getAiTags(parentId) { + return request({ + url: '/api/tag/list', + method: 'get', + params: { parentId } + }) +} + +// NanoBanana 专用回调地址(供调试使用) +export const NANO_CALLBACK_URL = import.meta.env.VITE_NANO_CALLBACK_URL || 'https://your-domain.com/api/ai/nano-callback' diff --git a/portal-ui/src/router/index.js b/portal-ui/src/router/index.js index 488c41d..ea5a894 100644 --- a/portal-ui/src/router/index.js +++ b/portal-ui/src/router/index.js @@ -121,6 +121,16 @@ export const constantRoutes = [{ permission: "pass", icon: 'btn_kjsp' } + }, { + path: 'generated-images', + name: 'generated-images', + component: () => import('@/views/GeneratedImages.vue'), + meta: { + title: 'AI文生图', + menuItem: true, + permission: "pass", + icon: 'btn_kjst' + } }, { path: 'recharge', name: 'recharge', diff --git a/portal-ui/src/views/GeneratedImages.vue b/portal-ui/src/views/GeneratedImages.vue new file mode 100644 index 0000000..158258f --- /dev/null +++ b/portal-ui/src/views/GeneratedImages.vue @@ -0,0 +1,325 @@ + + + + +