feat(v1.3.0): 图片编辑器(裁剪/旋转/图像大小/调色) + 批量水印 + AI生图 + 收藏体系 + 图片新窗口打开按钮 + 合拼拼图 + 返回顶部

This commit is contained in:
jinghui committed 2026-11-17 23:36:32 +08:00
1 parent e345456abf
commit 94ac94436c
46 files changed
+6521 -114

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
/**
* AI 生图 API
* 注意:client 的 API_BASE 已含 /api,这里只写 /aigen 段
*/
import { api } from '../client';
/** 模型分组 + 当前配置(apiKey 掩码) */
export function getModels() {
return api.get('/aigen/models');
}
/**
* 生成图片
* @param {Object} payload { prompt, model?, size?, provider? }
* provider: 'builtin' | 'custom'
*/
export function generate(payload) {
return api.post('/aigen/generate', payload, { timeout: 180000 });
}
export const aigenAPI = { getModels, generate };
export default aigenAPI;
+21
View File
@@ -0,0 +1,21 @@
/**
* 批量水印 API(文件夹级)
*/
import { api } from '../client';
/** 启动批量任务,返回 { taskId, total } */
export async function start(payload) {
// payload: { libraryId, folder, type: 'add'|'remove', output?, options }
return api.post('/batch/start', payload);
}
/** 查询任务进度 */
export async function status(taskId) {
return api.get(`/batch/status/${taskId}`);
}
/** 取消任务 */
export async function cancel(taskId) {
return api.post(`/batch/cancel/${taskId}`);
}
+7 -4
View File
@@ -19,8 +19,9 @@ export async function search(libraryId, params = {}, options = {}) {
/**
* 获取图片总数
*/
export async function getCount(libraryId) {
return api.get(`/image/count?libraryId=${libraryId}`);
export async function getCount(libraryId, params = {}) {
const query = new URLSearchParams({ libraryId, ...params });
return api.get(`/image/count?${query}`);
}
/**
@@ -48,8 +49,10 @@ export async function getCacheMeta(libraryId) {
* 获取缩略图 URL
* 使用分片结构,不再需要 size 参数
*/
export function getThumbnailUrl(libraryId, filename) {
return `/api/image/thumbnail/${libraryId}/${filename}`;
export function getThumbnailUrl(libraryId, filename, version) {
const base = `/api/image/thumbnail/${libraryId}/${filename}`;
// version=文件 modified_at,编辑保存后变化以穿透浏览器缓存
return version ? `${base}?v=${version}` : base;
}
/**