激活设备

This commit is contained in:
24kycj
2025-06-27 09:53:06 +08:00
parent 3e0f72e334
commit 11eb44f864
3 changed files with 45 additions and 2 deletions
+1 -1
View File
@@ -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', () => {
+1
View File
@@ -233,6 +233,7 @@ const defaultData = {
system_name: '', //主机名称
is_set_cddev: 0,
serial_no: '', //设备序列号
test_use: '', //试用天数
// 左右光盘桶
strong_list: [
{
+43 -1
View File
@@ -36,7 +36,14 @@
<div class="top_left_line"></div>
</div>
<div class="flex_box">
<div v-if="printer_info.test_use" class="top_tip">试用版 {{printer_info.test_use}}</div>
<template v-if="printer_info.test_use || printer_info.test_use === 0">
<div v-if="printer_info.test_use && printer_info.test_use === '0xFF'" class="top_tip"></div>
<template v-else-if="printer_info.test_use > -1">
<div class="top_tip">试用版 {{printer_info.test_use}}</div>
<el-button @click="handleActive" type="text" class="top_tip_btn">前往激活</el-button>
</template>
<div v-else-if="printer_info.test_use == -1" class="top_tip1">正在验证注册信息</div>
</template>
<user-info></user-info>
</div>
</div>
@@ -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;