update:配置是否可编辑rsa秘钥
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
<a-textarea
|
||||
v-model:value="rsaKeys.publicKey"
|
||||
:rows="5"
|
||||
readonly
|
||||
:readonly="readonly"
|
||||
placeholder="RSA公钥内容"
|
||||
@blur="readonly = true"
|
||||
@focus="readonly = false"
|
||||
/>
|
||||
<a-button
|
||||
type="primary"
|
||||
@@ -37,8 +39,10 @@
|
||||
<a-textarea
|
||||
v-model:value="rsaKeys.privateKey"
|
||||
:rows="5"
|
||||
readonly
|
||||
:readonly="readonly"
|
||||
placeholder="RSA私钥内容"
|
||||
@blur="readonly = true"
|
||||
@focus="readonly = false"
|
||||
/>
|
||||
<a-button
|
||||
type="primary"
|
||||
@@ -109,11 +113,13 @@ import {message} from 'ant-design-vue'
|
||||
import rsa from '@/utils/rsa'
|
||||
import {Activate} from "@/views/activate/index";
|
||||
|
||||
const RSA_CAN_EDIT = import.meta.env.VITE_RSA_CAN_EDIT === 'true'
|
||||
const rsaKeys = ref({
|
||||
publicKey: rsa.publicKey,
|
||||
privateKey: rsa.privateKey
|
||||
})
|
||||
const hiddenKeys = ref(false)
|
||||
const hiddenKeys = ref(RSA_CAN_EDIT)
|
||||
const readonly = ref(true)
|
||||
const activationForm = ref({
|
||||
requestCode: '',
|
||||
activationCode: ''
|
||||
@@ -124,6 +130,10 @@ const generating = ref(false)
|
||||
|
||||
// 生成激活码
|
||||
const generateActivationCode = () => {
|
||||
if (!rsaKeys.value.publicKey || !rsaKeys.value.privateKey) {
|
||||
message.error('请先配置RSA密钥')
|
||||
return
|
||||
}
|
||||
if (!activationForm.value.requestCode.trim()) {
|
||||
message.error('请输入设备申请码')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user