修正表数据不正确
This commit is contained in:
parent
f635063ec3
commit
8f7f6d0034
1752
data/web/index.html
1752
data/web/index.html
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "toonflow",
|
"name": "toonflow",
|
||||||
"version": "1.1.5",
|
"version": "1.1.6",
|
||||||
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
||||||
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
28
src/app.ts
28
src/app.ts
@ -8,15 +8,43 @@ import expressWs from "express-ws";
|
|||||||
import logger from "morgan";
|
import logger from "morgan";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import buildRoute from "@/core";
|
import buildRoute from "@/core";
|
||||||
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import u from "@/utils";
|
import u from "@/utils";
|
||||||
import jwt from "jsonwebtoken";
|
import jwt from "jsonwebtoken";
|
||||||
import socketInit from "@/socket/index";
|
import socketInit from "@/socket/index";
|
||||||
|
import { isEletron } from "@/utils/getPath";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer(app);
|
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) {
|
export default async function startServe(randomPort: Boolean = false) {
|
||||||
|
await checkPermissions();
|
||||||
|
|
||||||
await u.writeVersion();
|
await u.writeVersion();
|
||||||
const io = new Server(server, { cors: { origin: "*" } });
|
const io = new Server(server, { cors: { origin: "*" } });
|
||||||
socketInit(io);
|
socketInit(io);
|
||||||
|
|||||||
@ -560,38 +560,38 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
|||||||
await knex("o_vendorConfig").insert([
|
await knex("o_vendorConfig").insert([
|
||||||
{
|
{
|
||||||
id: "toonflow",
|
id: "toonflow",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "volcengine",
|
id: "volcengine",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "minimax",
|
id: "minimax",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "openai",
|
id: "openai",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "klingai",
|
id: "klingai",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "vidu",
|
id: "vidu",
|
||||||
inputValues: "",
|
inputValues: "{}",
|
||||||
models: [],
|
models: "[]",
|
||||||
enable: 0,
|
enable: 0,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user