From 22570341ef2a23e4f61d8d3f7c13065c0ea3ff62 Mon Sep 17 00:00:00 2001 From: hermes Date: Sat, 21 Nov 2026 14:56:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(protect):=20=E9=9D=A2=E6=9D=BF=E3=80=8C?= =?UTF-8?q?=E5=8A=A0=E5=A3=B3=E5=8A=A0=E5=9B=BA=E3=80=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pages/admin/protect/index.vue:应用选择 + 拖拽/点击上传 exe + 统计卡 + 任务表(状态轮询 2s、下载、删除) - 路由 /admin/protect、侧边栏入口(PackageCheck)、面包屑 titleMap - i18n zh/en 各补 nav.protect + admin.protect 38 键 - seedtest 增加面板管理员(admin/admin123)便于本地端到端验证 --- backend/cmd/seedtest/main.go | 14 +- .../src/components/admin-sidebar/index.vue | 7 +- frontend/src/layouts/admin.vue | 1 + frontend/src/pages/admin/protect/index.vue | 497 ++++++++++++++++++ frontend/src/plugins/i18n/en.json | 82 ++- frontend/src/plugins/i18n/zh.json | 100 ++-- frontend/src/router/routes.ts | 6 + frontend/src/types/route-map.d.ts | 16 +- 8 files changed, 651 insertions(+), 72 deletions(-) create mode 100644 frontend/src/pages/admin/protect/index.vue diff --git a/backend/cmd/seedtest/main.go b/backend/cmd/seedtest/main.go index 6cf8f2f..9793399 100644 --- a/backend/cmd/seedtest/main.go +++ b/backend/cmd/seedtest/main.go @@ -14,6 +14,8 @@ import ( "verification-platform-backend/internal/database" "verification-platform-backend/internal/model" "verification-platform-backend/internal/utils/contentstore" + + "golang.org/x/crypto/bcrypt" ) func main() { @@ -28,7 +30,17 @@ func main() { config.Init() database.Init() // 内部已执行 AutoMigrate - // 1) 用户 + // 1) 用户(面板登录用的 User 表,role=admin) + var admin model.User + database.DB.Where("username = ?", "admin").First(&admin) + if admin.ID == 0 { + hash, _ := bcrypt.GenerateFromPassword([]byte("admin123"), bcrypt.DefaultCost) + admin = model.User{Username: "admin", Password: string(hash), Role: "admin", Status: "active"} + must(database.DB.Create(&admin).Error) + fmt.Println("管理员: admin / admin123") + } + + // 2) 应用所属用户(客户端账号表) var user model.AppUser database.DB.Where("username = ?", "seeduser").First(&user) if user.ID == 0 { diff --git a/frontend/src/components/admin-sidebar/index.vue b/frontend/src/components/admin-sidebar/index.vue index b632733..f8de4c0 100644 --- a/frontend/src/components/admin-sidebar/index.vue +++ b/frontend/src/components/admin-sidebar/index.vue @@ -1,5 +1,5 @@ + + diff --git a/frontend/src/plugins/i18n/en.json b/frontend/src/plugins/i18n/en.json index ae88f35..fb4966d 100644 --- a/frontend/src/plugins/i18n/en.json +++ b/frontend/src/plugins/i18n/en.json @@ -275,15 +275,10 @@ "applicationRequired": "Please select application", "deviceId": "Device ID", "deviceIdPlaceholder": "Device ID (optional)", - "preview": "Preview", - "app": "Application", - "usernameLabel": "Username", - "emailLabel": "Email", "deviceIdLabel": "Device ID", "status": "Account Status", "onlineStatus": "Online Status", "submit": "Save", - "cancel": "Cancel", "fetchFailed": "Failed to fetch user information", "success": "User updated successfully", "failed": "Failed to update user", @@ -1156,14 +1151,13 @@ "editSuccess": "Card type updated successfully", "create": { "title": "Create Card Type", - "description": "Create a new card type with basic information and recharge configuration", + "description": "Batch generate cards", "basicInfo": "Basic Information", "basicInfoDesc": "Fill in the basic information of the card type", "billingConfig": "Billing Configuration", "billingConfigDesc": "Select the billing method and value settings", "name": "Type Name", "namePlaceholder": "Enter type name", - "description": "Batch generate cards", "descriptionPlaceholder": "Enter description", "application": "Application", "selectApplication": "Select application", @@ -2195,7 +2189,14 @@ "batchUpdateSuccess": "Batch update successful", "batchUpdateFailed": "Batch update failed", "select": "Select", - "edit": "Edit", + "edit": { + "title": "Edit Cloud Function", + "titleDescription": "Edit cloud function configuration", + "config": "Configuration", + "configDesc": "Edit cloud function basic information and code", + "submitBtn": "Save", + "cancelBtn": "Cancel" + }, "editSuccess": "Updated successfully", "editFailed": "Failed to fetch cloud function", "columns": { @@ -2233,14 +2234,6 @@ "submitSuccess": "Created successfully", "submitFailed": "Failed to create" }, - "edit": { - "title": "Edit Cloud Function", - "titleDescription": "Edit cloud function configuration", - "config": "Configuration", - "configDesc": "Edit cloud function basic information and code", - "submitBtn": "Save", - "cancelBtn": "Cancel" - }, "updateSuccess": "Updated successfully", "updateFailed": "Failed to update", "fetchFailed": "Failed to fetch cloud function" @@ -2569,6 +2562,46 @@ "faviconSuccess": "Favicon uploaded successfully", "uploadFailed": "Upload failed" } + }, + "protect": { + "title": "Protection", + "description": "Inject a verification shell into your program: entry rewrite + in-memory DLL + dual CRC32, single-file output", + "totalTasks": "Total tasks", + "inProgress": "In progress", + "doneCount": "Completed", + "failedCount": "Failed", + "uploadTitle": "Upload program", + "uploadHint": "32/64-bit Windows PE, up to 200MB. Output is unsigned — Windows will warn about unknown publisher", + "app": "Application", + "dropHint": "Click to choose or drop an .exe file", + "onlyExe": "Only .exe files are supported", + "tooLarge": "File too large (max 200MB)", + "pickApp": "Choose an application first", + "pickFile": "Choose a program first", + "queued": "Submitted, protecting…", + "uploading": "Uploading", + "start": "Start", + "clear": "Clear", + "tasks": "Protection tasks", + "source": "Source / output", + "arch": "Arch", + "status": "Status", + "createdAt": "Created", + "actions": "Actions", + "download": "Download", + "refresh": "Refresh", + "loading": "Loading…", + "empty": "No protection tasks yet", + "allStatus": "All status", + "statusPending": "Queued", + "statusRunning": "Protecting", + "statusDone": "Completed", + "statusFailed": "Failed", + "busy": "Task is running, try later", + "deleted": "Deleted", + "failed": "Operation failed", + "loadFailed": "Failed to load tasks", + "loadAppsFailed": "Failed to load applications" } }, "auth": { @@ -2809,7 +2842,11 @@ "noUsers": "No user records yet", "username": "Username", "email": "Email", - "status": "Status", + "status": { + "active": "Active", + "disabled": "Disabled", + "banned": "Banned" + }, "registerTime": "Register Time", "lastLogin": "Last Login", "active": "Active", @@ -2845,11 +2882,6 @@ "expired": "Expired", "daysLeft": "days left" }, - "status": { - "active": "Active", - "disabled": "Disabled", - "banned": "Banned" - }, "create": { "title": "Create User", "description": "Create a new user under your application", @@ -2950,7 +2982,6 @@ "exportBtn": "Export", "batchExportBtn": "Batch Export", "application": "Application", - "cardType": "Card Type", "reset": "Reset", "select": "Select", "columns": { @@ -2998,7 +3029,6 @@ "application": "Select Application", "selectApplication": "Please select an application", "cardType": "Select Card Type", - "selectCardType": "Please select a card type", "noCardType": "No available card types for this application", "count": "Quantity", "maxCount": "Maximum 100 cards per generation", @@ -3006,7 +3036,6 @@ "app": "Application", "type": "Card Type", "unitPrice": "Unit Price", - "quantity": "Quantity", "units": "cards", "totalAmount": "Estimated Cost", "generateNow": "Generate Now" @@ -3222,7 +3251,8 @@ "normal": "Normal", "storage": "Storage", "admin": "Admin", - "agent": "Agent" + "agent": "Agent", + "protect": "Protection" }, "footer": { "brand": "Weishouquan", diff --git a/frontend/src/plugins/i18n/zh.json b/frontend/src/plugins/i18n/zh.json index 8b502c1..65b89f5 100644 --- a/frontend/src/plugins/i18n/zh.json +++ b/frontend/src/plugins/i18n/zh.json @@ -275,15 +275,10 @@ "applicationRequired": "请选择应用", "deviceId": "设备指纹", "deviceIdPlaceholder": "设备指纹(可选)", - "preview": "预览", - "app": "应用", - "usernameLabel": "用户名", - "emailLabel": "邮箱", "deviceIdLabel": "设备指纹", "status": "账户状态", "onlineStatus": "在线状态", "submit": "保存", - "cancel": "取消", "fetchFailed": "获取用户信息失败", "success": "保存成功", "failed": "保存失败", @@ -1311,8 +1306,7 @@ "save": "保存", "usernameHint": "用户名不可修改", "passwordPlaceholder": "留空则不修改密码", - "passwordHint": "输入新密码以修改,留空保持原密码", - "saveBtn": "保存修改" + "passwordHint": "如需修改密码请输入新密码,留空则保持原密码" }, "editSuccess": "更新代理成功", "editFailed": "更新代理失败", @@ -1332,18 +1326,7 @@ "batchDeleteSuccess": "批量删除成功", "batchDeleteFailed": "批量删除失败", "batchUpdateSuccess": "批量更新成功", - "batchUpdateFailed": "批量更新失败", - "edit": { - "title": "编辑代理", - "description": "修改代理信息", - "fetchFailed": "获取代理信息失败", - "saveSuccess": "保存成功", - "saveFailed": "保存失败", - "save": "保存", - "usernameHint": "用户名不可修改", - "passwordPlaceholder": "留空则不修改密码", - "passwordHint": "如需修改密码请输入新密码,留空则保持原密码" - } + "batchUpdateFailed": "批量更新失败" }, "announcements": { "title": "公告管理", @@ -1592,14 +1575,13 @@ "editSuccess": "更新卡类成功", "create": { "title": "创建卡类", - "description": "创建新的卡密类型,设置基本信息和充值配置", + "description": "描述", "basicInfo": "基本信息", "basicInfoDesc": "填写卡类的基本信息", "billingConfig": "充值配置", "billingConfigDesc": "设置卡密充值金额", "name": "类型名称", "namePlaceholder": "请输入类型名称", - "description": "描述", "descriptionPlaceholder": "请输入描述", "application": "所属应用", "selectApplication": "请选择应用", @@ -2226,7 +2208,14 @@ "batchUpdateSuccess": "批量更新成功", "batchUpdateFailed": "批量更新失败", "select": "选择", - "edit": "编辑", + "edit": { + "title": "编辑云端函数", + "titleDescription": "编辑云端函数配置", + "config": "配置", + "configDesc": "编辑云端函数的基本信息和代码", + "submitBtn": "保存", + "cancelBtn": "取消" + }, "editSuccess": "更新成功", "editFailed": "获取云端函数失败", "columns": { @@ -2264,14 +2253,6 @@ "submitSuccess": "创建成功", "submitFailed": "创建失败" }, - "edit": { - "title": "编辑云端函数", - "titleDescription": "编辑云端函数配置", - "config": "配置", - "configDesc": "编辑云端函数的基本信息和代码", - "submitBtn": "保存", - "cancelBtn": "取消" - }, "updateSuccess": "更新成功", "updateFailed": "更新失败", "fetchFailed": "获取云端函数失败" @@ -2600,6 +2581,46 @@ "faviconSuccess": "图标上传成功", "uploadFailed": "上传失败" } + }, + "protect": { + "title": "加壳加固", + "description": "给程序注入验证壳:改入口 + 内存加载壳 DLL + 双层 CRC32,产物单文件、免安装依赖", + "totalTasks": "任务总数", + "inProgress": "进行中", + "doneCount": "已完成", + "failedCount": "失败", + "uploadTitle": "上传程序", + "uploadHint": "支持 32 / 64 位 Windows PE,最大 200MB;产物未签名,Windows 会提示未知发布者", + "app": "应用", + "dropHint": "点击选择或拖入 .exe 文件", + "onlyExe": "只支持 .exe 文件", + "tooLarge": "文件过大(上限 200MB)", + "pickApp": "请先选择应用", + "pickFile": "请先选择要加壳的程序", + "queued": "已提交,正在加壳", + "uploading": "上传中", + "start": "开始加壳", + "clear": "清除", + "tasks": "加壳任务", + "source": "源文件 / 产物", + "arch": "架构", + "status": "状态", + "createdAt": "创建时间", + "actions": "操作", + "download": "下载", + "refresh": "刷新", + "loading": "加载中…", + "empty": "还没有加壳任务", + "allStatus": "全部状态", + "statusPending": "排队中", + "statusRunning": "加壳中", + "statusDone": "已完成", + "statusFailed": "失败", + "busy": "任务执行中,稍后再删", + "deleted": "已删除", + "failed": "操作失败", + "loadFailed": "加载任务失败", + "loadAppsFailed": "加载应用失败" } }, "auth": { @@ -2840,7 +2861,11 @@ "noUsers": "暂无用户记录", "username": "用户名", "email": "邮箱", - "status": "状态", + "status": { + "active": "正常", + "disabled": "禁用", + "banned": "封禁" + }, "registerTime": "注册时间", "lastLogin": "最后登录", "active": "正常", @@ -2876,11 +2901,6 @@ "expired": "已过期", "daysLeft": "天剩余" }, - "status": { - "active": "正常", - "disabled": "禁用", - "banned": "封禁" - }, "create": { "title": "创建用户", "description": "在您的应用下创建新用户", @@ -2981,7 +3001,6 @@ "exportBtn": "导出", "batchExportBtn": "批量导出", "application": "应用", - "cardType": "卡类", "reset": "重置", "select": "选择", "columns": { @@ -3014,7 +3033,7 @@ "selectAppPlaceholder": "请选择应用", "selectCardTypeLabel": "选择卡类", "selectCardTypePlaceholder": "请选择卡类", - "quantity": "生成数量", + "quantity": "数量", "quantityPlaceholder": "请输入生成数量", "quantityHint": "单次最多生成 100 张卡密", "estimatedCost": "预计费用", @@ -3029,7 +3048,6 @@ "application": "选择应用", "selectApplication": "请选择应用", "cardType": "选择卡类", - "selectCardType": "请选择卡类", "noCardType": "该应用暂无可用卡类", "count": "生成数量", "maxCount": "单次最多生成 100 张卡密", @@ -3037,7 +3055,6 @@ "app": "应用", "type": "卡类", "unitPrice": "单价", - "quantity": "数量", "units": "张", "totalAmount": "预计费用", "generateNow": "立即生成" @@ -3253,7 +3270,8 @@ "normal": "正常", "storage": "存储", "admin": "管理员", - "agent": "代理商" + "agent": "代理商", + "protect": "加壳加固" }, "footer": { "brand": "网络验证", diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index c474527..1817a13 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -107,6 +107,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/pages/admin/versions/index.vue'), meta: { title: '版本管理 - 管理后台' }, }, + { + path: 'protect', + name: 'AdminProtect', + component: () => import('@/pages/admin/protect/index.vue'), + meta: { title: '加壳加固 - 管理后台' }, + }, { path: 'versions/create', name: 'AdminVersionCreate', diff --git a/frontend/src/types/route-map.d.ts b/frontend/src/types/route-map.d.ts index b10dd04..2604cd1 100644 --- a/frontend/src/types/route-map.d.ts +++ b/frontend/src/types/route-map.d.ts @@ -14,9 +14,6 @@ import type { ParamValueZeroOrMore, ParamValueZeroOrOne, } from 'vue-router' -import type { - _ExtractParamParserType, -} from 'vue-router/experimental' declare module 'vue-router' { interface TypesConfig { @@ -342,6 +339,13 @@ declare module 'vue-router/auto-routes' { Record, | never >, + '/admin/protect/': RouteRecordInfo< + '/admin/protect/', + '/admin/protect', + Record, + Record, + | never + >, '/admin/risk-control/': RouteRecordInfo< '/admin/risk-control/', '/admin/risk-control', @@ -948,6 +952,12 @@ declare module 'vue-router/auto-routes' { views: | never } + 'src/pages/admin/protect/index.vue': { + routes: + | '/admin/protect/' + views: + | never + } 'src/pages/admin/risk-control/index.vue': { routes: | '/admin/risk-control/'