| | |
| | | <div class="sys-right">
|
| | | <div class="auto">
|
| | | <div class="title-bg">
|
| | | <div class="title">Smart AIOS</div>
|
| | | <div class="desc">Copyright © 贝思科技术有限公司</div>
|
| | | <div class="title">{{ productName }}</div>
|
| | | <div class="desc">{{ copyright }}</div>
|
| | | </div>
|
| | | <div class="bar" style="background-color: #f2f2f7">
|
| | | <div class="name">版本:</div>
|
| | | <div class="desc">
|
| | | {{
|
| | | serializedNumber == "" ? "SmartAIOS试用版" : "SmartAIOS正式版"
|
| | | }}
|
| | | {{ serializedNumber == "" ? `${productName}试用版` : `${productName}正式版` }}
|
| | | </div>
|
| | | </div>
|
| | | <div class="bar">
|
| | | <div class="name">激活:</div>
|
| | | <div class="right-zone">
|
| | | <el-button
|
| | | type="primary"
|
| | | size="small"
|
| | | @click="confirmAgain"
|
| | | v-if="serializedNumber != ''"
|
| | | <el-button type="primary" size="small" @click="confirmAgain" v-if="serializedNumber != ''"
|
| | | >导出产品密钥</el-button
|
| | | >
|
| | | <div class="desc activation">
|
| | |
| | | </div>
|
| | | <div class="bar">
|
| | | <div class="name" style="min-width: 65px">请求码:</div>
|
| | | <div class="desc code" style="font-size: 12px">{{ q }}</div>
|
| | | <div class="desc code" style="font-size: 12px">{{ queryCode }}</div>
|
| | | </div>
|
| | | <div class="bar">
|
| | | <div class="name">产品密钥:</div>
|
| | |
| | | </div>
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | title="再次确认"
|
| | | :visible.sync="dialogVisible"
|
| | | custom-class="my-confirm"
|
| | | >
|
| | | <el-dialog title="再次确认" :visible.sync="dialogVisible" custom-class="my-confirm">
|
| | | <div class="ver">
|
| | | <span
|
| | | class="iconfont"
|
| | | style="color: orangered; font-size: 40px; margin-bottom: 10px"
|
| | | ></span
|
| | | >
|
| | | <span class="iconfont" style="color: orangered; font-size: 40px; margin-bottom: 10px"></span>
|
| | | <span class="ver-text">
|
| | | 产品密钥导出后,系统大部分功能将无法使用,请确认是否继续?
|
| | | </span>
|
| | |
| | | <ul>
|
| | | <li style="list-style: inside">如系统已激活,在激活页面导出即可;</li>
|
| | | <li style="list-style: inside">
|
| | | 如设备未激活,在SmartAI激活页面扫码获取
|
| | | {{ `"如设备未激活,请在${product_name}激活页面扫码获取"` }}
|
| | | </li>
|
| | | </ul>
|
| | | <!-- <span style="color: #8f949a; font-size: 14px"
|
| | |
| | | </div>
|
| | | <!-- -->
|
| | | <div class="pw">
|
| | | <el-input
|
| | | size="small"
|
| | | placeholder="请输入管理员密码"
|
| | | v-model="password"
|
| | | ></el-input>
|
| | | <el-input size="small" placeholder="请输入管理员密码" v-model="password"></el-input>
|
| | | </div>
|
| | | <div class="validate">
|
| | | <form id="myForm">
|
| | |
| | | >
|
| | | </el-input>
|
| | | </form>
|
| | | <el-button size="small" @click="txtbtn" type="primary"
|
| | | >导入文件</el-button
|
| | | >
|
| | | <input
|
| | | type="file"
|
| | | @change="loadTextFromFile"
|
| | | id="txt"
|
| | | style="display: none"
|
| | | />
|
| | | <el-button size="small" @click="txtbtn" type="primary">导入文件</el-button>
|
| | | <input type="file" @change="loadTextFromFile" id="txt" style="display: none" />
|
| | | </div>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getSN, cancelAuthorization } from "@/api/system";
|
| | | import { getSN, cancelAuthorization, getVasystemInfo } from "@/api/system"
|
| | |
|
| | | export default {
|
| | | mounted() {
|
| | | this.refreshSn();
|
| | | this.refreshSn()
|
| | | },
|
| | | data() {
|
| | | return {
|
| | |
| | | expireTime: "",
|
| | | serializedNumber: "",
|
| | | secrectKey: "",
|
| | | q: "",
|
| | | queryCode: "",
|
| | | activeState: "已激活",
|
| | | password: "",
|
| | | dialogVisible: false,
|
| | | };
|
| | | productName: "",
|
| | | copyright: ""
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | refreshSn() {
|
| | | getSN().then((res) => {
|
| | | if (res.code == 200) {
|
| | | this.authorization = res.data.authorization;
|
| | | this.expireTime = res.data.expireTime;
|
| | | this.serializedNumber = res.data.sn;
|
| | | this.q = res.data.q;
|
| | | this.authorization = res.data.authorization
|
| | | this.expireTime = res.data.expireTime
|
| | | this.serializedNumber = res.data.sn
|
| | | this.queryCode = res.data.q
|
| | | }
|
| | | });
|
| | | })
|
| | |
|
| | | getVasystemInfo().then((rsp) => {
|
| | | this.productName = rsp.product_name
|
| | | this.copyright = rsp.copyright
|
| | | })
|
| | | },
|
| | | confirmAgain() {
|
| | | this.dialogVisible = true;
|
| | | this.dialogVisible = true
|
| | | },
|
| | | txtbtn() {
|
| | | document.getElementById("txt").click();
|
| | | document.getElementById("txt").click()
|
| | | },
|
| | | loadTextFromFile(e) {
|
| | | const file = e.target.files[0];
|
| | | var reader = new FileReader(); //new一个FileReader实例
|
| | | let that = this;
|
| | | reader.onload = function () {
|
| | | that.secrectKey = this.result.trim();
|
| | | };
|
| | | reader.readAsText(file);
|
| | | const file = e.target.files[0]
|
| | | var reader = new FileReader() //new一个FileReader实例
|
| | | let that = this
|
| | | reader.onload = function() {
|
| | | that.secrectKey = this.result.trim()
|
| | | }
|
| | | reader.readAsText(file)
|
| | | },
|
| | | confirmCancel() {
|
| | | this.secrectKey = this.secrectKey.trim();
|
| | | this.password = this.password.trim();
|
| | | this.secrectKey = this.secrectKey.trim()
|
| | | this.password = this.password.trim()
|
| | | if (this.secrectKey == "" || this.password == "") {
|
| | | this.$message.warning("请先填写密码和请求码");
|
| | | return;
|
| | | this.$message.warning("请先填写密码和请求码")
|
| | | return
|
| | | }
|
| | | cancelAuthorization({
|
| | | q: this.secrectKey,
|
| | | passwd: this.password,
|
| | | down: 1,
|
| | | down: 1
|
| | | }).then((res) => {
|
| | | if (res.type == "application/json") {
|
| | | var reader = new FileReader();
|
| | | reader.readAsText(res, "utf-8");
|
| | | let that = this;
|
| | | reader.onload = function () {
|
| | | var receive_data = JSON.parse(this.result); //这个就是解析出来的数据
|
| | | that.$notify.error(receive_data.msg);
|
| | | };
|
| | | return;
|
| | | var reader = new FileReader()
|
| | | reader.readAsText(res, "utf-8")
|
| | | let that = this
|
| | | reader.onload = function() {
|
| | | var receive_data = JSON.parse(this.result) //这个就是解析出来的数据
|
| | | that.$notify.error(receive_data.msg)
|
| | | }
|
| | | return
|
| | | }
|
| | | let url = window.URL.createObjectURL(
|
| | | new Blob([res], { type: "text/plain" })
|
| | | );
|
| | | let a = document.createElement("a");
|
| | | a.href = url;
|
| | | a.download = "key.txt";
|
| | | a.click();
|
| | | window.URL.revokeObjectURL(url);
|
| | | this.refreshSn();
|
| | | window.parent.postMessage({ msg: "checkSN" }, "*");
|
| | | this.$notify.success("导出成功");
|
| | | this.dialogVisible = false;
|
| | | });
|
| | | },
|
| | | },
|
| | | };
|
| | | let url = window.URL.createObjectURL(new Blob([res], { type: "text/plain" }))
|
| | | let a = document.createElement("a")
|
| | | a.href = url
|
| | | a.download = "key.txt"
|
| | | a.click()
|
| | | window.URL.revokeObjectURL(url)
|
| | | this.refreshSn()
|
| | | window.parent.postMessage({ msg: "checkSN" }, "*")
|
| | | this.$notify.success("导出成功")
|
| | | this.dialogVisible = false
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <style lang="scss">
|
| | | div {
|
| | |
| | | border-left: 4px solid #f2f2f7;
|
| | |
|
| | | .el-dialog {
|
| | | width: 640px; border-radius: 24px;
|
| | |
|
| | | width: 640px;
|
| | | border-radius: 24px;
|
| | | }
|
| | |
|
| | | .el-dialog__header {
|
| | |
| | | }
|
| | | .el-dialog__footer {
|
| | | padding: 10px 20px 20px;
|
| | | .btns {
|
| | | display: flex;
|
| | | justify-content: right;
|
| | | .cancel {
|
| | | width: 140px;
|
| | | height: 40px;
|
| | | cursor: pointer;
|
| | | border-radius: 20px;
|
| | | line-height: 40px;
|
| | | font-size: 14px;
|
| | | color: var(--colorCard);
|
| | | border-color: var(--colorCard) !important;
|
| | | .btns {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | | .ok {
|
| | | width: 140px;
|
| | | height: 40px;
|
| | | cursor: pointer;
|
| | | border-radius: 20px;
|
| | | background-color: var(--colorCard) !important;
|
| | | border-color: var(--colorCard) !important;
|
| | | color: #fff;
|
| | | line-height: 40px;
|
| | | font-size: 14px;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | justify-content: right;
|
| | | .cancel {
|
| | | width: 140px;
|
| | | height: 40px;
|
| | | cursor: pointer;
|
| | | border-radius: 20px;
|
| | | line-height: 40px;
|
| | | font-size: 14px;
|
| | | color: var(--colorCard);
|
| | | border-color: var(--colorCard) !important;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | | .ok {
|
| | | width: 140px;
|
| | | height: 40px;
|
| | | cursor: pointer;
|
| | | border-radius: 20px;
|
| | | background-color: var(--colorCard) !important;
|
| | | border-color: var(--colorCard) !important;
|
| | | color: #fff;
|
| | | line-height: 40px;
|
| | | font-size: 14px;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | .el-divider--horizontal {
|
| | | margin: 20px 0;
|
| | | }
|
| | |
| | | align-items: baseline;
|
| | | margin-top: 15px;
|
| | | .el-button--small {
|
| | | font-size: 14px;
|
| | | border-radius: 3px;
|
| | | border-radius: 16px;
|
| | | background-color: var(--colorCard) !important;
|
| | | border-color: var(--colorCard) !important;
|
| | | min-width: 120px; padding: 8px 15px;
|
| | |
|
| | | }
|
| | | font-size: 14px;
|
| | | border-radius: 3px;
|
| | | border-radius: 16px;
|
| | | background-color: var(--colorCard) !important;
|
| | | border-color: var(--colorCard) !important;
|
| | | min-width: 120px;
|
| | | padding: 8px 15px;
|
| | | }
|
| | | }
|
| | | #myForm {
|
| | | display: flex;
|
| | |
| | | box-sizing: border-box;
|
| | | position: relative;
|
| | | padding: 10px 15px 0 10px;
|
| | | .el-form-item.is-required:not(.is-no-asterisk)
|
| | | > .el-form-item__label:before,
|
| | | .el-form-item.is-required:not(.is-no-asterisk)
|
| | | .el-form-item__label-wrap
|
| | | > .el-form-item__label:before {
|
| | | .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before,
|
| | | .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label:before {
|
| | | display: none;
|
| | | }
|
| | | .el-select {
|