Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop

This commit is contained in:
zhishi 2026-04-14 18:00:37 +08:00
commit 0507fadfda
4 changed files with 919 additions and 887 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "toonflow",
"version": "1.1.5",
"version": "1.1.6",
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
"author": "HBAI-Ltd <ltlctools@outlook.com>",
"license": "Apache-2.0",

View File

@ -8,15 +8,43 @@ import expressWs from "express-ws";
import logger from "morgan";
import cors from "cors";
import buildRoute from "@/core";
import path from "path";
import fs from "fs";
import u from "@/utils";
import jwt from "jsonwebtoken";
import socketInit from "@/socket/index";
import { isEletron } from "@/utils/getPath";
const app = express();
const server = http.createServer(app);
async function checkPermissions() {
if (!isEletron()) return true;
const userDataPath = u.getPath();
try {
fs.mkdirSync(userDataPath, { recursive: true });
const testFile = path.join(userDataPath, ".access_test");
fs.writeFileSync(testFile, "test");
fs.unlinkSync(testFile);
} catch (e) {
const { dialog, app } = require("electron");
const { response } = await dialog.showMessageBox({
type: "warning",
title: "权限不足",
message: "应用无法访问数据目录",
detail: `无法读写以下目录:\n${userDataPath}\n\n请联系管理员授予权限或以管理员身份运行本程序。`,
buttons: ["确认退出"],
defaultId: 0,
});
if (response === 0) {
app.quit();
}
}
}
export default async function startServe(randomPort: Boolean = false) {
await checkPermissions();
await u.writeVersion();
const io = new Server(server, { cors: { origin: "*" } });
socketInit(io);

View File

@ -560,38 +560,38 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
await knex("o_vendorConfig").insert([
{
id: "toonflow",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
{
id: "volcengine",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
{
id: "minimax",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
{
id: "openai",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
{
id: "klingai",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
{
id: "vidu",
inputValues: "",
models: [],
inputValues: "{}",
models: "[]",
enable: 0,
},
]);