2021-12-21 23:10:34 +00:00
|
|
|
|
<style scoped>
|
|
|
|
|
label {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
.item-desc {
|
|
|
|
|
color: #aaa;
|
|
|
|
|
font-size: small;
|
|
|
|
|
display: block;
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
margin-top: 0.2em;
|
|
|
|
|
}
|
|
|
|
|
.item-desc a {
|
|
|
|
|
color: #aaa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
form >>> input {
|
|
|
|
|
font-family: 'Courier New', Courier, monospace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
* >>> .um-config-dialog {
|
|
|
|
|
max-width: 90%;
|
|
|
|
|
width: 40em;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
2021-12-19 23:03:46 +00:00
|
|
|
|
<template>
|
2022-11-26 23:21:19 +00:00
|
|
|
|
<el-dialog
|
|
|
|
|
@close="cancel()"
|
|
|
|
|
title="解密设定"
|
|
|
|
|
v-model="internalShow"
|
|
|
|
|
class="um-config-dialog"
|
|
|
|
|
center
|
|
|
|
|
>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
status-icon
|
|
|
|
|
:model="form"
|
|
|
|
|
label-width="0"
|
|
|
|
|
>
|
2021-12-21 23:10:34 +00:00
|
|
|
|
<section>
|
|
|
|
|
<label>
|
|
|
|
|
<span>
|
|
|
|
|
JOOX Music ·
|
2021-12-22 13:39:47 +00:00
|
|
|
|
<Ruby caption="Unique Device Identifier">设备唯一识别码</Ruby>
|
2021-12-21 23:10:34 +00:00
|
|
|
|
</span>
|
|
|
|
|
<el-form-item prop="jooxUUID">
|
2022-11-26 23:21:19 +00:00
|
|
|
|
<el-input
|
|
|
|
|
type="text"
|
|
|
|
|
v-model="form.jooxUUID"
|
|
|
|
|
clearable
|
|
|
|
|
maxlength="32"
|
|
|
|
|
show-word-limit
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
2021-12-21 23:10:34 +00:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<p class="item-desc">
|
|
|
|
|
下载该加密文件的 JOOX 应用所记录的设备唯一识别码。
|
|
|
|
|
<br />
|
|
|
|
|
参见:
|
2022-11-26 23:21:19 +00:00
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/unlock-music/joox-crypto/wiki/%E8%8E%B7%E5%8F%96%E8%AE%BE%E5%A4%87-UUID"
|
|
|
|
|
>
|
2021-12-21 23:10:34 +00:00
|
|
|
|
获取设备 UUID · unlock-music/joox-crypto Wiki</a
|
|
|
|
|
>。
|
|
|
|
|
</p>
|
|
|
|
|
</section>
|
2021-12-19 23:03:46 +00:00
|
|
|
|
</el-form>
|
2022-11-26 23:21:19 +00:00
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button type="primary" :loading="saving" @click="emitConfirm()">
|
|
|
|
|
确 定
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
2021-12-19 23:03:46 +00:00
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-12-20 22:19:44 +00:00
|
|
|
|
import { storage } from '@/utils/storage';
|
2021-12-22 13:39:47 +00:00
|
|
|
|
import Ruby from './Ruby';
|
2021-12-19 23:03:46 +00:00
|
|
|
|
|
2021-12-21 23:10:34 +00:00
|
|
|
|
// FIXME: 看起来不会触发这个验证提示?
|
|
|
|
|
function validateJooxUUID(rule, value, callback) {
|
|
|
|
|
if (!value || !/^[\da-fA-F]{32}$/.test(value)) {
|
|
|
|
|
callback(new Error('无效的 Joox UUID,请参考 Wiki 获取。'));
|
|
|
|
|
} else {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const rules = {
|
2021-12-22 13:28:38 +00:00
|
|
|
|
jooxUUID: { validator: validateJooxUUID, trigger: 'change' },
|
2021-12-21 23:10:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
2021-12-19 23:03:46 +00:00
|
|
|
|
export default {
|
2021-12-22 13:39:47 +00:00
|
|
|
|
components: {
|
|
|
|
|
Ruby,
|
|
|
|
|
},
|
2021-12-19 23:03:46 +00:00
|
|
|
|
props: {
|
|
|
|
|
show: { type: Boolean, required: true },
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2021-12-21 23:10:34 +00:00
|
|
|
|
rules,
|
2021-12-19 23:03:46 +00:00
|
|
|
|
saving: false,
|
|
|
|
|
form: {
|
|
|
|
|
jooxUUID: '',
|
|
|
|
|
},
|
2022-11-26 23:21:19 +00:00
|
|
|
|
internalShow: false,
|
2021-12-19 23:03:46 +00:00
|
|
|
|
centerDialogVisible: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
2022-11-26 23:21:19 +00:00
|
|
|
|
watch: {
|
|
|
|
|
show(newValue, oldValue) {
|
|
|
|
|
this.internalShow = newValue;
|
|
|
|
|
},
|
|
|
|
|
},
|
2021-12-19 23:03:46 +00:00
|
|
|
|
async mounted() {
|
|
|
|
|
await this.resetForm();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async resetForm() {
|
|
|
|
|
this.form.jooxUUID = await storage.loadJooxUUID();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async cancel() {
|
|
|
|
|
await this.resetForm();
|
|
|
|
|
this.$emit('done');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async emitConfirm() {
|
|
|
|
|
this.saving = true;
|
|
|
|
|
await storage.saveJooxUUID(this.form.jooxUUID);
|
|
|
|
|
this.saving = false;
|
|
|
|
|
this.$emit('done');
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|