whycwx
2022-05-21 93fef7442fbfff2f0e8f1cd352eae5d79c41c93e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
    <div class="consolt">
        <el-input
            class="text"
            type="textarea"
            autosize
            placeholder="请输入内容"
            v-model="textarea1">
        </el-input> <br/>
        <div class="boxP" v-if="status">
            <p><span>cpu序列号:</span><i>{{cpuId}}</i></p>
            <!-- <p><span>cpuIdRsa:</span><i>{{cpuIdRsa}}</i></p> -->
            <p><span>主板序列号:</span><i>{{boardId}}</i></p>
            <!-- <p><span>boardIdRsa:</span><i>{{boardIdRsa}}</i></p> -->
        </div>
        <br/>
        <el-button type="primary" @click="getData()">解码信息</el-button>
    </div>
</template>
<script>
export default {
    data(){
        return{
            textarea1:"",
            status:false,
            cpuId:"123",
            // cpuIdRsa:"456",
            boardId:"789",
            // boardIdRsa:"000"
        }
    },
    mounted(){
        
    },
    methods: {
        // 解码
        getData:function(){
            let vm = this;
                vm.status = true;
                // encodeURIComponent();
                if(vm.textarea1 == ""){
                    vm.$message({
                        message: '解码信息不能为空!',
                        type: 'warning'
                    });
                }else{
                    let params = {
                            serialNumberMixRSA : encodeURIComponent(vm.textarea1)
                        } 
                    vm.$axios({
                        method: 'GET',
                        url: '/RsaEncry/ComInfoController/getComInfo',
                        params: params,
                    }).then(res=>{
                        let rs = res.data;
                            if(rs.code == 1){
                                vm.cpuId = rs.data.cpuId;
                                vm.boardId = rs.data.boardId;
                            }else{
                                vm.$message({
                                    message: '解码失败,请重试!',
                                    type: 'warning'
                                });
                            }
                    })
                }
        }
    },
}
</script>
<style scoped>
    .consolt{
        text-align: center;
    }
    .text{
        width: 60%;
        margin-bottom: 50px;
        
    }
    /deep/.el-textarea__inner{
        min-height: 300px !important;
    }
    .boxP{
        width: 60%;
        margin-bottom: 20px;
        display: inline-block;
        text-align: left;
    }
    
    .boxP span{
        display: inline-block;
        width: 160px;
        text-align: right;
        margin-right: 40px;
    }
    .boxP i{
        color: red;
    }
</style>