From 11eb44f8642264e044eb10011ea6d3f54193499b Mon Sep 17 00:00:00 2001 From: 24kycj <1637269896@qq.com> Date: Fri, 27 Jun 2025 09:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BF=80=E6=B4=BB=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.dev.js | 2 +- src/renderer/store/modules/chat.js | 1 + src/renderer/views/dashboard/index.vue | 44 +++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/main/index.dev.js b/src/main/index.dev.js index 1d10bc4..1fbb870 100644 --- a/src/main/index.dev.js +++ b/src/main/index.dev.js @@ -8,7 +8,7 @@ /* eslint-disable */ // Install `electron-debug` with `devtron` -require('electron-debug')({ showDevTools: true }) +require('electron-debug')({ showDevTools: false }) // Install `vue-devtools` require('electron').app.on('ready', () => { diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index f2d95f7..022312b 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -233,6 +233,7 @@ const defaultData = { system_name: '', //主机名称 is_set_cddev: 0, serial_no: '', //设备序列号 + test_use: '', //试用天数 // 左右光盘桶 strong_list: [ { diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index 87be8ae..14bc568 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -36,7 +36,14 @@
-
试用版 {{printer_info.test_use}}天
+
@@ -333,6 +340,7 @@ import UserInfo from '@/components/userInfo/userInfo.vue' import WorkAdd from '@/components/workAdd/workAdd.vue' const exePath = !app.isPackaged ? process.cwd() : path.dirname(process.execPath) const shPath = path.join(exePath, 'CardsoonServer', 'control.sh') +const activePath = path.join(exePath, 'CardsoonServer', 'regist.sh') export default { name: 'dashboard', components: { UserInfo, WorkAdd }, @@ -726,6 +734,31 @@ export default { that.serviceLoading = false }) }, + // 激活设备 + handleActive() { + let that = this + that + .$prompt('请输入管理员密码并点击确定以前往激活设备', '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + inputType: 'password' + }) + .then(({ value }) => { + that + .$runCmd(`bash ${activePath} ${value}`) + .then((res) => { + + }) + .catch((err) => { + that.$message({ + message: err, + type: 'error' + }) + }) + }) + .catch(() => { + }) + }, // 执行 handleRun() { if (!that.workStatus) { @@ -1209,6 +1242,15 @@ $red: #ff0000; font-size: 14px; color: #000; } + .top_tip1 { + font-size: 14px; + color: #279fd0; + } + .top_tip_btn { + font-size: 14px; + text-decoration: underline; + padding: 0 20px; + } } .content_body { background-color: #f8f8f8;