chore: 清理 env 废弃变量、移除旧模型配置,补充 Music 平台文档与大小写归一化修复
- .env 文件移除未使用的 VITE_API_PAY_* 变量,更新生产环境 URL - 删除 5 个已废弃的 model-configs JSON 文件 - CLAUDE.md 新增 Music 平台架构说明与计费类型映射 - getPlatformCode / getChargeType 增加输入大小写归一化
This commit is contained in:
parent
79afa037e2
commit
4d76899488
@ -5,10 +5,6 @@ VITE_BASE = '/'
|
||||
VITE_API_PREFIX = '/api'
|
||||
VITE_API_BASE_URL = 'http://test.xueai.art/newapi/api' # http://huanda.xueai.art http://106.54.11.219/api 43.248.131.153:8003
|
||||
|
||||
# 支付服务
|
||||
VITE_API_PAY_PREFIX = '/pay'
|
||||
VITE_API_PAY_TARGET = 'http://test.xueai.art' # http://43.248.133.202 test.xueai.art
|
||||
|
||||
# 任务处理模块
|
||||
VITE_API_WORKFLOW_UPLOAD = 'http://test.xueai.art/AIGC/Temp/uploadImage' # https://sxwz.xueai.art/workflow https://designtools.xueai.art/workflow
|
||||
VITE_API_TASK_PREFIX = '/suanli'
|
||||
|
||||
@ -6,21 +6,15 @@ VITE_BUILD_MOCK = false
|
||||
|
||||
# 主服务
|
||||
VITE_API_PREFIX = '/api'
|
||||
VITE_API_BASE_URL = 'https://sxwz.xueai.art/api'
|
||||
|
||||
# 支付服务
|
||||
VITE_API_PAY_PREFIX = '/pay'
|
||||
VITE_API_PAY_TARGET = 'https://sxwz.xueai.art' # http://43.248.133.202
|
||||
VITE_API_BASE_URL = 'https://sxwz.xueai.art/newapi/api'
|
||||
|
||||
# 任务处理模块
|
||||
VITE_API_WORKFLOW_UPLOAD = 'https://designtools.xueai.art/workflow/file/upload' # https://sxwz.xueai.art/workflow https://designtools.xueai.art/workflow
|
||||
VITE_API_WORKFLOW_UPLOAD = 'https://resources.xueai.art/AIGC/Temp/uploadImage' # https://sxwz.xueai.art/workflow https://designtools.xueai.art/workflow
|
||||
VITE_API_TASK_PREFIX = '/suanli'
|
||||
VITE_API_TASK_TARGET = 'http://test.xueai.art'
|
||||
|
||||
# 模型资源
|
||||
VITE_API_MODEL_RESOURCE = 'https://resources.xueai.art/AIGC'
|
||||
VITE_API_TASK_TARGET = 'https://sxwz.xueai.art'
|
||||
|
||||
# 是否开启KKFileView
|
||||
FILE_OPEN_PREVIEW = false
|
||||
# KKFileView服务器地址
|
||||
# FILE_VIEW_SERVER_URL = 'http://192.168.122.209:8012'
|
||||
# FILE_VIEW_SERVER_URL = 'http://192.168.122.209:8012'.
|
||||
|
||||
|
||||
44
CLAUDE.md
44
CLAUDE.md
@ -18,9 +18,9 @@ Vue 3 (Composition API) + Vite 7 + Pinia + Vue Router + Element Plus + `vue-elem
|
||||
|
||||
## 架构概览
|
||||
|
||||
AI 绘画/视频生成前端操作平台,通过 HTTP 接口对接算力调度后端(suanli),提交生成任务并轮询结果。
|
||||
AI 绘画/视频/音乐生成前端操作平台,通过 HTTP 接口对接算力调度后端(suanli),提交生成任务并轮询结果。
|
||||
|
||||
**核心架构:Platform Descriptor 模式。** Painting 和 Video 是两个独立的平台包,通过统一的注册表动态加载。dialogBox 是通用编排壳,不包含任何平台特定逻辑。
|
||||
**核心架构:Platform Descriptor 模式。** Painting、Video 和 Music 是三个独立的平台包,通过统一的注册表动态加载。dialogBox 是通用编排壳,不包含任何平台特定逻辑。
|
||||
|
||||
### 关键目录
|
||||
|
||||
@ -54,6 +54,15 @@ src/
|
||||
│ ├── pattern.vue
|
||||
│ ├── proportion.vue
|
||||
│ └── time.vue
|
||||
│ └── music/ # Music 平台
|
||||
│ ├── index.js # defineMusicPlatform()
|
||||
│ ├── modelSelector.vue
|
||||
│ ├── imageUploader.vue
|
||||
│ └── controls/
|
||||
│ ├── modeSelector.vue # 模式选择(常用/专业/Remix/编辑)
|
||||
│ ├── pureMusicGroup.vue # 纯音乐开关 + 歌词输入弹窗
|
||||
│ ├── lyricsInput.vue # 专业模式歌词输入
|
||||
│ └── timeControl.vue # 时长滑块(常用模式)
|
||||
├── stores/ # Pinia 状态管理
|
||||
│ ├── user.js # 用户认证、信息(含 sessionId),pinia persist 持久化 token
|
||||
│ ├── display.js # 生成历史列表、UI 状态(滚动、画布等)
|
||||
@ -234,6 +243,36 @@ Video 的 `getDefaultModel()` 返回 `''`,不硬编码 UUID;模型列表加
|
||||
}
|
||||
```
|
||||
|
||||
### Music 平台特有行为
|
||||
|
||||
Music 平台与 Painting/Video 的关键差异:
|
||||
|
||||
- **模式驱动控件显隐**:`mode` ref(常用模式/专业模式/Remix模式/编辑模式)决定大部分控件的 `show()`。切换模式时 `visibleControls` 自动更新。
|
||||
- **纯音乐/歌词互斥**:常用模式下 `pureMusicGroup` 控件内含纯音乐开关 + 歌词输入弹窗。开关开启时清空歌词;关闭时弹出歌词输入框。`buildTaskBody` 中 `pureMusic` 为 true 时 `lyrics` 为空字符串。
|
||||
- **参考音频**:`imageUploader` 用于上传音频文件(非图片),仅在专业模式下显示(`showImageUploader()` → `mode === '专业模式'`),且为必填(`isImageRequired()` → true)。
|
||||
- **数量限制**:专业模式下 `quantity` 强制为 1(`props()` 中做 `Math.min(mode === '专业模式' ? 1 : maxQty)`)。
|
||||
- **Music 独有控件**:
|
||||
|
||||
| 控件 | `name` | `beforeModel` | 作用 |
|
||||
|------|--------|---------------|------|
|
||||
| `ModeSelector` | `modeSelector` | `true`(在模型选择器前) | 常用/专业/Remix/编辑 四选一 |
|
||||
| `PureMusicGroup` | `pureMusicGroup` | `false` | 纯音乐开关 + 歌词输入(仅常用模式显示) |
|
||||
| `LyricsInput` | `lyricsInput` | `false` | 歌词输入(仅专业模式显示) |
|
||||
| `TimeControl` | `timeControl` | `false` | 时长滑块 min~max(仅常用模式显示) |
|
||||
|
||||
- **`handledUis`**(Music ParamGroup 过滤用):`['textarea', 'proportion', 'imageUpload', 'hidden', 'quantity']`,额外按名称排除 `['mode', 'pureMusic', 'lyrics', 'duration', 'quantity']`。
|
||||
|
||||
### 计费类型映射(`getChargeType`)
|
||||
|
||||
`taskPolling.js` 中的 `getChargeType(chargeType)` 将平台类型映射为计费数字:
|
||||
|
||||
| 平台 | 计费码 |
|
||||
|------|--------|
|
||||
| Painting | 1 |
|
||||
| Video | 4 |
|
||||
| Music | 5 |
|
||||
| 其他 | 2 |
|
||||
|
||||
### 组件规范
|
||||
|
||||
**禁止在项目组件中使用外部 UI 库**(Element Plus 等),图标除外。自定义组件使用项目自研的 `Select`、`Popover` 或纯 CSS 实现。`SwitchControl` 即为一例——纯 CSS 滑动开关,不依赖 `el-switch`。
|
||||
@ -358,6 +397,7 @@ FILE_OPEN_PREVIEW = true # 是否开启 KKFileView 预览
|
||||
|------|----------|
|
||||
| Painting | `ai_painting_talk` |
|
||||
| Video | `ai_video_talk` |
|
||||
| Music | `ai_music_talk` |
|
||||
|
||||
映射函数 `getPlatformCode()` 位于 `utils/modelApi.js`。
|
||||
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
{
|
||||
"modelName": "海螺 02-fast 图生视频",
|
||||
"modelDescription": "RunningHub MiniMax 海螺 02-fast 图生视频模型,基于参考图生成快节奏电影感动画",
|
||||
"endpoint": "/minimax/hailuo-02/fast",
|
||||
"params": [
|
||||
{
|
||||
"name": "prompt",
|
||||
"ui": "textarea",
|
||||
"label": "提示词",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "enablePromptExpansion",
|
||||
"ui": "switch",
|
||||
"label": "提示词扩展",
|
||||
"default": true,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "imageUrl",
|
||||
"ui": "imageUpload",
|
||||
"label": "参考图片",
|
||||
"maxCount": 1,
|
||||
"required": true,
|
||||
"maxSizeMB": 10
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"ui": "select",
|
||||
"label": "时长(秒)",
|
||||
"default": "6",
|
||||
"options": ["6", "10"],
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"promptPlaceholder": "描述基于原图的动画效果(可选)。",
|
||||
"inputType": "image",
|
||||
"maxImages": 1
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
{
|
||||
"modelName": "LTX-2.3 图生视频",
|
||||
"modelDescription": "RunningHub LTX-2.3 图生视频模型,基于图片生成视频",
|
||||
"endpoint": "/rhart-video/ltx-2.3/image-to-video",
|
||||
"params": [
|
||||
{
|
||||
"name": "imageUrl",
|
||||
"ui": "imageUpload",
|
||||
"label": "参考图片",
|
||||
"maxCount": 1,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"ui": "textarea",
|
||||
"label": "提示词",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"ui": "proportion",
|
||||
"label": "画面比例",
|
||||
"default": "16:9",
|
||||
"options": ["9:16", "16:9"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"ui": "resolution",
|
||||
"label": "分辨率",
|
||||
"default": "720p",
|
||||
"options": ["480p", "720p", "1080p"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"ui": "select",
|
||||
"label": "时长(秒)",
|
||||
"default": 5,
|
||||
"options": [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"promptPlaceholder": "描述图片和期望的视频运动效果。",
|
||||
"inputType": "image",
|
||||
"maxImages": 1
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
"modelName": "LTX-2.3 文生视频",
|
||||
"modelDescription": "RunningHub LTX-2.3 文生视频模型(Text-to-Video),基于文本生成视频",
|
||||
"endpoint": "/rhart-video/ltx-2.3/text-to-video",
|
||||
"params": [
|
||||
{
|
||||
"name": "prompt",
|
||||
"ui": "textarea",
|
||||
"label": "提示词",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"ui": "select",
|
||||
"label": "分辨率",
|
||||
"default": "720p",
|
||||
"options": ["1080p", "720p", "480p"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"ui": "proportion",
|
||||
"label": "画面比例",
|
||||
"default": "16:9",
|
||||
"options": ["16:9", "9:16"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"ui": "number",
|
||||
"label": "时长(秒)",
|
||||
"default": 5,
|
||||
"min": 5,
|
||||
"max": 15,
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"promptPlaceholder": "描述你想生成的画面和动作。",
|
||||
"inputType": "text"
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
{
|
||||
"modelName": "Vidu 首尾帧生视频 q3-turbo",
|
||||
"modelDescription": "RunningHub Vidu 首尾帧生视频 q3-turbo 模型,通过首尾帧图片驱动视频生成,支持音视频直出",
|
||||
"endpoint": "/vidu/start-end-to-video-q3-turbo",
|
||||
"params": [
|
||||
{
|
||||
"name": "prompt",
|
||||
"ui": "textarea",
|
||||
"label": "提示词",
|
||||
"required": true,
|
||||
"maxLength": 4000
|
||||
},
|
||||
{
|
||||
"name": "firstImageUrl",
|
||||
"ui": "imageUpload",
|
||||
"label": "首帧图片",
|
||||
"maxCount": 1,
|
||||
"required": true,
|
||||
"maxSizeMB": 50
|
||||
},
|
||||
{
|
||||
"name": "lastImageUrl",
|
||||
"ui": "imageUpload",
|
||||
"label": "尾帧图片",
|
||||
"maxCount": 1,
|
||||
"required": true,
|
||||
"maxSizeMB": 50
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"ui": "select",
|
||||
"label": "时长(秒)",
|
||||
"default": "5",
|
||||
"options": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"ui": "resolution",
|
||||
"label": "分辨率",
|
||||
"default": "720p",
|
||||
"options": ["540p", "720p", "1080p"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "movementAmplitude",
|
||||
"ui": "select",
|
||||
"label": "运动幅度",
|
||||
"default": "auto",
|
||||
"options": ["auto", "small", "medium", "large"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "audio",
|
||||
"ui": "switch",
|
||||
"label": "音频直出",
|
||||
"default": true,
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"promptPlaceholder": "描述首尾帧之间的动作补全。文本长度限制 1-4000。",
|
||||
"inputType": "image",
|
||||
"maxImages": 2
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
{
|
||||
"modelName": "Vidu 文生视频 q3-turbo",
|
||||
"modelDescription": "RunningHub Vidu 文生视频 q3-turbo 模型,支持音视频直出",
|
||||
"endpoint": "/vidu/text-to-video-q3-turbo",
|
||||
"params": [
|
||||
{
|
||||
"name": "prompt",
|
||||
"ui": "textarea",
|
||||
"label": "提示词",
|
||||
"required": true,
|
||||
"maxLength": 4000
|
||||
},
|
||||
{
|
||||
"name": "style",
|
||||
"ui": "select",
|
||||
"label": "风格",
|
||||
"default": "general",
|
||||
"options": ["general", "anime"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "aspectRatio",
|
||||
"ui": "proportion",
|
||||
"label": "画面比例",
|
||||
"default": "16:9",
|
||||
"options": ["4:3", "3:4", "16:9", "9:16", "1:1"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "resolution",
|
||||
"ui": "resolution",
|
||||
"label": "分辨率",
|
||||
"default": "720p",
|
||||
"options": ["540p", "720p", "1080p"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"ui": "select",
|
||||
"label": "时长(秒)",
|
||||
"default": "5",
|
||||
"options": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "audio",
|
||||
"ui": "switch",
|
||||
"label": "音频直出",
|
||||
"default": true,
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"promptPlaceholder": "描述你想生成的视频画面和音频。文本长度限制 1-4000。",
|
||||
"inputType": "text"
|
||||
}
|
||||
@ -39,7 +39,8 @@ function saveToCache(code, models) {
|
||||
|
||||
// 类型 → 平台编码映射
|
||||
export function getPlatformCode(type) {
|
||||
switch (type) {
|
||||
const normalized = type.charAt(0).toUpperCase() + type.slice(1).toLowerCase()
|
||||
switch (normalized) {
|
||||
case 'Painting':
|
||||
return 'ai_painting_talk'
|
||||
case 'Video':
|
||||
|
||||
@ -5,7 +5,8 @@ import { useDisplayStore, useUserStore } from '@/stores'
|
||||
import { userError } from '@/utils/tokenError'
|
||||
|
||||
export function getChargeType(chargeType) {
|
||||
switch (chargeType) {
|
||||
const normalized = chargeType.charAt(0).toUpperCase() + chargeType.slice(1).toLowerCase()
|
||||
switch (normalized) {
|
||||
case 'Painting':
|
||||
return 1
|
||||
case 'Video':
|
||||
|
||||
Loading…
Reference in New Issue
Block a user