diff --git a/frontend/electron/services/logService.ts b/frontend/electron/services/logService.ts index 8efc88c..95102e1 100644 --- a/frontend/electron/services/logService.ts +++ b/frontend/electron/services/logService.ts @@ -53,7 +53,9 @@ export function setupLogger() { log.transports.file.maxSize = 50 * 1024 * 1024 // 禁用自动归档,因为我们按日期分文件 - log.transports.file.archiveLog = null + log.transports.file.archiveLog = () => { + /* do nothing */ + }; // 捕获未处理的异常和Promise拒绝 log.catchErrors({ diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 4f223ec..c6f489b 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -46,6 +46,30 @@ const routes: RouteRecordRaw[] = [ component: () => import('../views/UserEdit.vue'), meta: { title: '编辑用户' }, }, + { + path: '/scripts/:scriptId/users/add/maa', + name: 'MAAUserAdd', + component: () => import('../views/MAAUserEdit.vue'), + meta: { title: '添加MAA用户' }, + }, + { + path: '/scripts/:scriptId/users/:userId/edit/maa', + name: 'MAAUserEdit', + component: () => import('../views/MAAUserEdit.vue'), + meta: { title: '编辑MAA用户' }, + }, + { + path: '/scripts/:scriptId/users/add/general', + name: 'GeneralUserAdd', + component: () => import('../views/GeneralUserEdit.vue'), + meta: { title: '添加通用用户' }, + }, + { + path: '/scripts/:scriptId/users/:userId/edit/general', + name: 'GeneralUserEdit', + component: () => import('../views/GeneralUserEdit.vue'), + meta: { title: '编辑通用用户' }, + }, { path: '/plans', name: 'Plans', diff --git a/frontend/src/views/GeneralUserEdit.vue b/frontend/src/views/GeneralUserEdit.vue new file mode 100644 index 0000000..563195b --- /dev/null +++ b/frontend/src/views/GeneralUserEdit.vue @@ -0,0 +1,758 @@ + + + + + + 脚本管理 + + + + {{ scriptName }} + + + + {{ isEdit ? '编辑用户' : '添加用户' }} + + + + + + + + + + 通用配置 + + + + + + 返回 + + + + + + {{ isEdit ? '保存修改' : '创建用户' }} + + + + + + + + + + + + + + 用户名 + + + + + + + + + + + + + 启用状态 + + + + + + 是 + 否 + + + + + + + + + + + + 剩余天数 + + + + + + + + + + + + + + + + + 备注 + + + + + + + + + + + + + + + + 任务前执行脚本 + + + + + + 启用后将在任务执行前运行指定脚本 + + + + + + + + 任务后执行脚本 + + + + + + 启用后将在任务执行后运行指定脚本 + + + + + + + + + + + 任务前脚本 + + + + + + + + + + + + + 任务后脚本 + + + + + + + + + + + + + + 启用通知 + + + + 启用后将发送任务通知 + + + + + + + 通知内容 + + + 统计信息 + + + + + + + + 邮件通知 + + + + + + + + + + + Server酱 + + + + + + + + + + + 企业微信群机器人 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/views/MAAUserEdit.vue b/frontend/src/views/MAAUserEdit.vue new file mode 100644 index 0000000..85bbbb1 --- /dev/null +++ b/frontend/src/views/MAAUserEdit.vue @@ -0,0 +1,1344 @@ + + + + + + 脚本管理 + + + + {{ scriptName }} + + + + {{ isEdit ? '编辑用户' : '添加用户' }} + + + + + + + + + + MAA配置 + + + + + + 返回 + + + + + + {{ isEdit ? '保存修改' : '创建用户' }} + + + + + + + + + + + + + + 用户名 + + + + + + + + + + + + + 账号ID + + + + + + + + + + + + + + + + 启用状态 + + + + + + 是 + 否 + + + + + + + + + 密码 + + + + + + + + + + + + + + + 服务器 + + + + + + + + + + + + + + 剩余天数 + + + + + + + + + + + + + + + + 用户配置模式 + + + + + + + + + + + + + + 基建模式 + + + + + + + + + + + + + + + + + 基建配置文件 + + + + + + + + 选择文件 + + + 导入配置 + + + + 请选择有效的基建配置JSON文件,点击「导入配置」按钮将其应用到当前用户。如果已经导入,可以忽略此选择框。 + + + + + + + + + + 备注 + + + + + + + + + + + + + + + + 剿灭代理 + + + + + + + + + + + + + 关卡配置模式 + + + + + + + + + + + + + + + 吃理智药数量 + + + + + + + + + + + + + 连战次数 + + + + + + + + + + + + + + 关卡选择 + + + + + + + + {{ option.label.split('|')[0] }} + + {{ option.label.split('|')[1] }} + + + + {{ option.label }} + + + + + + + + + + + + + 备选关卡-1 + + + + + + + + {{ option.label.split('|')[0] }} + + {{ option.label.split('|')[1] }} + + + + {{ option.label }} + + + + + + + + + + + 备选关卡-2 + + + + + + + + {{ option.label.split('|')[0] }} + + {{ option.label.split('|')[1] }} + + + + {{ option.label }} + + + + + + + + + + + 备选关卡-3 + + + + + + + + {{ option.label.split('|')[0] }} + + {{ option.label.split('|')[1] }} + + + + {{ option.label }} + + + + + + + + + + + 剩余理智关卡 + + + + + + + + {{ option.label.split('|')[0] }} + + {{ option.label.split('|')[1] }} + + + + {{ option.label }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 自动肉鸽 + + + + + + + + + + + 生息演算 + + + + + + + + + + + + + 森空岛签到 + + + + 开启后将启用森空岛签到功能 + + + + + 森空岛Token + + + 请在森空岛官网获取您的专属Token并粘贴到此处,详细教程见 + 获取鹰角网络通行证登录凭证 + 文档 + + + + + + + + + 启用通知 + + + + 启用后将发送此用户的任务通知到选中的渠道 + + + + + + 通知内容 + + + 统计信息 + + 公开招募高资喜报 + + + + + + + + 邮件通知 + + + + + + + + + + + Server酱 + + + + + + + + + + + 企业微信群机器人 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/views/UserEdit.vue b/frontend/src/views/UserEdit.vue index c0b8613..04273f6 100644 --- a/frontend/src/views/UserEdit.vue +++ b/frontend/src/views/UserEdit.vue @@ -1266,6 +1266,24 @@ const loadScriptInfo = async () => { scriptName.value = script.name scriptType.value = script.type // 设置脚本类型 + // 根据脚本类型重定向到对应的专用页面 + if (script.type === 'MAA') { + if (isEdit.value) { + router.replace(`/scripts/${scriptId}/users/${userId}/edit/maa`) + } else { + router.replace(`/scripts/${scriptId}/users/add/maa`) + } + return + } else if (script.type === 'General') { + if (isEdit.value) { + router.replace(`/scripts/${scriptId}/users/${userId}/edit/general`) + } else { + router.replace(`/scripts/${scriptId}/users/add/general`) + } + return + } + + // 如果脚本类型未知,继续使用原有逻辑(向后兼容) // 重新初始化表单数据(根据脚本类型) const defaultData = scriptType.value === 'MAA' ? getDefaultMAAUserData() : getDefaultGeneralUserData()