From 55ff45f9a99b23f0bc6c695a59a68966edf7c42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E5=90=8C=E5=AD=A6?= Date: Tue, 14 Oct 2025 19:00:47 +0800 Subject: [PATCH] =?UTF-8?q?ADD:=20=E6=A8=A1=E5=9D=97=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/controller/example.js | 36 -- electron/service/example.js | 29 -- frontend/.env.development | 2 + frontend/.env.production | 2 + frontend/src/api/activate/index.ts | 14 + frontend/src/api/activate/interface/index.ts | 55 ++ .../src/layouts/components/Footer/index.vue | 67 ++- .../components/Header/components/Avatar.vue | 350 +++++++------ frontend/src/routers/index.ts | 92 ++-- frontend/src/routers/modules/staticRouter.ts | 3 +- frontend/src/stores/modules/auth.ts | 180 +++---- frontend/src/utils/ipcRenderer.js | 18 +- frontend/src/views/home/index.vue | 97 +--- frontend/src/views/home/tabs/model.vue | 485 +++++++++--------- .../src/views/login/components/LoginForm.vue | 27 +- .../views/system/versionRegister/index.vue | 330 ++++++++++-- 16 files changed, 976 insertions(+), 811 deletions(-) delete mode 100644 electron/controller/example.js delete mode 100644 electron/service/example.js create mode 100644 frontend/src/api/activate/index.ts create mode 100644 frontend/src/api/activate/interface/index.ts diff --git a/electron/controller/example.js b/electron/controller/example.js deleted file mode 100644 index 52baff0..0000000 --- a/electron/controller/example.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const { Controller } = require('ee-core'); -const Log = require('ee-core/log'); -const Services = require('ee-core/services'); - -/** - * example - * @class - */ -class ExampleController extends Controller { - - constructor(ctx) { - super(ctx); - } - - - /** - * 所有方法接收两个参数 - * @param args 前端传的参数 - * @param event - ipc通信时才有值。详情见:控制器文档 - */ - - /** - * test - */ - async test () { - const result = await Services.get('example').test('electron'); - Log.info('service result:', result); - - return 'hello electron-egg'; - } -} - -ExampleController.toString = () => '[class ExampleController]'; -module.exports = ExampleController; \ No newline at end of file diff --git a/electron/service/example.js b/electron/service/example.js deleted file mode 100644 index 99a81c3..0000000 --- a/electron/service/example.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const { Service } = require('ee-core'); - -/** - * 示例服务(service层为单例) - * @class - */ -class ExampleService extends Service { - - constructor(ctx) { - super(ctx); - } - - /** - * test - */ - async test(args) { - let obj = { - status:'ok', - params: args - } - - return obj; - } -} - -ExampleService.toString = () => '[class ExampleService]'; -module.exports = ExampleService; \ No newline at end of file diff --git a/frontend/.env.development b/frontend/.env.development index 92c4237..55c97ff 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -23,3 +23,5 @@ VITE_API_URL=/api VITE_PROXY=[["/api","http://192.168.1.124:18092/"]] #VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 +# 开启激活验证 +VITE_ACTIVATE_OPEN=true \ No newline at end of file diff --git a/frontend/.env.production b/frontend/.env.production index aadfb6c..9102cda 100644 --- a/frontend/.env.production +++ b/frontend/.env.production @@ -24,3 +24,5 @@ VITE_PWA=true # 线上环境接口地址 #VITE_API_URL="/api" # 打包时用 VITE_API_URL="http://192.168.1.125:18092/" +# 开启激活验证 +VITE_ACTIVATE_OPEN=true \ No newline at end of file diff --git a/frontend/src/api/activate/index.ts b/frontend/src/api/activate/index.ts new file mode 100644 index 0000000..13eade5 --- /dev/null +++ b/frontend/src/api/activate/index.ts @@ -0,0 +1,14 @@ +import http from '@/api' +import type { Activate } from '@/api/activate/interface' + +export const generateApplicationCode = (params: Activate.ApplicationCodePlaintext) => { + return http.post(`/activate/generateApplicationCode`, params) +} + +export const verifyActivationCode = (activationCode: string) => { + return http.post(`/activate/verifyActivationCode`, { activationCode }) +} + +export const getLicense = () => { + return http.post(`/activate/getLicense`) +} \ No newline at end of file diff --git a/frontend/src/api/activate/interface/index.ts b/frontend/src/api/activate/interface/index.ts new file mode 100644 index 0000000..b21e6cc --- /dev/null +++ b/frontend/src/api/activate/interface/index.ts @@ -0,0 +1,55 @@ +//激活模块 +export namespace Activate { + + export interface ApplicationModule { + /** + * 是否申请 1是 0否 + */ + apply: number; + } + + export interface ActivateModule extends ApplicationModule { + /** + * 是否永久 1是 0否 + */ + permanently: number; + } + + export interface ApplicationCodePlaintext { + + /** + * 模拟式模块 + */ + simulate: ApplicationModule; + + /** + * 数字式模块 + */ + digital: ApplicationModule; + + /** + * 比对式模块 + */ + contrast: ApplicationModule; + } + export interface ActivationCodePlaintext { + + /** + * 模拟式模块 + */ + simulate: ActivateModule; + + /** + * 数字式模块 + */ + digital: ActivateModule; + + /** + * 比对式模块 + */ + contrast: ActivateModule; + } + + + +} \ No newline at end of file diff --git a/frontend/src/layouts/components/Footer/index.vue b/frontend/src/layouts/components/Footer/index.vue index 4470ec1..36df60e 100644 --- a/frontend/src/layouts/components/Footer/index.vue +++ b/frontend/src/layouts/components/Footer/index.vue @@ -1,24 +1,21 @@ + + + \ No newline at end of file