2. 重构软件鉴权,添加自动判断机器码,可以不在手动点击确定 3. 新增软件启动时,提示用户是不是还存在等待中的任务,还有的话,由用户判断是不是丢弃,丢弃,会将所有的等待中的任务设置为失败 4. 聚合推文 提示词合并,人物、风格和场景 添加判无,修复部分情况无法合并 5. 新增 预设(人物,场景,风格)对提示词相关的提示 6. 修复 文案处理,流式输出内容重复问题,删除豆包(请求格式不兼容) 7. 新增 文案处理 输出内容一键格式化(注意:由于GPT输出的格式化有太多的不确定,不一定可以完全格式化,需要手动检查) 8. 聚合推文原创,新增时默认设置 修脸参数,初始和SD设置中的一致 9. 修复聚合推文选图覆盖 bug
60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import { shell } from "electron";
|
||
import { CheckFileOrDirExist } from "../../../define/Tools/file";
|
||
import { errorMessage, successMessage } from "../../Public/generalTools";
|
||
import path from 'path';
|
||
|
||
|
||
/** 打开指定的文件夹的方法 */
|
||
export type OpenFolderParams = {
|
||
/** 是不是基于项目文件,是的话,会在项目文件夹的基础上进行拼接 */
|
||
baseProject: boolean;
|
||
/** 判断是不是打开父文件夹 */
|
||
dirFloder: boolean;
|
||
/** 文件路径,baseProject 为false,需要设置完整的文件路径 */
|
||
folderPath: string;
|
||
}
|
||
|
||
/** 一些对electron接口的封装,配合业务逻辑 */
|
||
export default class ElectronInterface {
|
||
constructor() { }
|
||
|
||
/**
|
||
* 打开指定的文件,试用默认的打开方式
|
||
* @param value
|
||
* @returns
|
||
*/
|
||
public async OpenFile(value: string) {
|
||
if (await CheckFileOrDirExist(value)) {
|
||
return errorMessage('文件不存在', 'SystemIpc_OPEN_FILE')
|
||
}
|
||
await shell.openPath(value)
|
||
}
|
||
/**
|
||
* 打开对应的文件夹
|
||
* @param params
|
||
* @returns
|
||
*/
|
||
public async OpenFolder(params: OpenFolderParams) {
|
||
try {
|
||
let openFolder = null
|
||
if (params.baseProject) {
|
||
openFolder = path.join(global.config.project_path, params.folderPath)
|
||
}
|
||
if (params.dirFloder) {
|
||
openFolder = path.dirname(params.folderPath)
|
||
}
|
||
if (!openFolder) {
|
||
openFolder = params.folderPath
|
||
}
|
||
// 判断文件夹是不是存在
|
||
let isExist = await CheckFileOrDirExist(openFolder)
|
||
if (!isExist) {
|
||
throw new Error('文件夹不存在,请检查')
|
||
}
|
||
shell.openPath(openFolder)
|
||
return successMessage(null, '打开成功')
|
||
} catch (error) {
|
||
return errorMessage('打开文件夹错误,错误信息如下:' + error.message, 'SystemIpc_OPEN_FOLDER')
|
||
}
|
||
}
|
||
} |