|
1 | 1 | <template>
|
| 2 | +<div> |
| 3 | + <el-row> |
| 4 | + <el-col :span="2" :offset="8" class="left"> |
| 5 | + 指定序列号 |
| 6 | + </el-col> |
| 7 | + <el-col :span="4"> |
| 8 | + <el-input v-model="serial"> </el-input> |
| 9 | + </el-col> |
| 10 | + <el-col :span="2" > |
| 11 | + <el-button @click="submit">查询</el-button> |
| 12 | + </el-col> |
| 13 | + </el-row> |
2 | 14 | <el-descriptions
|
3 | 15 | direction="vertical"
|
4 | 16 | border
|
5 | 17 | :column="1"
|
6 |
| - > |
7 |
| - <el-descriptions-item label="证书版本">{{cert.version}}</el-descriptions-item> |
8 |
| - <el-descriptions-item label="序列号">{{cert.sn}}</el-descriptions-item> |
9 |
| - <el-descriptions-item label="签名算法" >{{cert.signalg}}</el-descriptions-item> |
10 |
| - <el-descriptions-item label="签发者"> {{cert.signer}} </el-descriptions-item> |
11 |
| - <el-descriptions-item label="有效期"> </el-descriptions-item> |
12 |
| - |
13 |
| - <el-descriptions-item label="公钥算法"></el-descriptions-item> |
14 |
| - |
15 |
| - |
| 18 | + v-show="show" |
| 19 | + > |
| 20 | + <el-descriptions-item label="证书公钥">{{cert.pub_key}}</el-descriptions-item> |
| 21 | + <el-descriptions-item label="证书序列号">{{cert.serial}}</el-descriptions-item> |
| 22 | + <el-descriptions-item label="国家" > {{cert.subjectName.C}}</el-descriptions-item> |
| 23 | + <el-descriptions-item label="省份"> {{cert.subjectName.ST}} </el-descriptions-item> |
| 24 | + <el-descriptions-item label="城市"> {{cert.subjectName.L}}</el-descriptions-item> |
| 25 | + <el-descriptions-item label="组织"> {{cert.subjectName.O}}</el-descriptions-item> |
16 | 26 | </el-descriptions>
|
| 27 | +</div> |
17 | 28 | </template>
|
18 | 29 |
|
19 | 30 | <script>
|
| 31 | +import axios from 'axios' |
| 32 | +import Cookies from 'js-cookie' |
| 33 | +import msg from '../js/msg'; |
| 34 | +const url = location.origin + "/ca/info"; |
20 | 35 | export default {
|
21 | 36 | name: 'info',
|
22 | 37 | data() {
|
23 | 38 | return {
|
24 | 39 | cert: {
|
25 |
| - version: '', |
26 |
| - sn: '', |
27 |
| - signalg: '', |
28 |
| - signer: '' |
29 |
| - } |
| 40 | + pub_key: '', |
| 41 | + serial: '', |
| 42 | + subjectName: { |
| 43 | + C: '', |
| 44 | + CN: '', |
| 45 | + L: '', |
| 46 | + O:'', |
| 47 | + ST: '' |
| 48 | + } |
| 49 | + }, |
| 50 | + show: false, |
| 51 | + serial: '' |
| 52 | + } |
| 53 | + }, |
| 54 | + methods: { |
| 55 | + submit() { |
| 56 | + axios.post(url, {"serial": this.serial}, { |
| 57 | + headers: { |
| 58 | + "X-CSRF-TOKEN": Cookies.get("X-CSRF-TOKEN"), |
| 59 | + }, |
| 60 | + withCredentials: true |
| 61 | + }).then((response) => { |
| 62 | + if (response.data.error == 1) { |
| 63 | + msg.msFail("failed"); |
| 64 | + } else { |
| 65 | + this.cert = response.data; |
| 66 | + console.log(this.cert); |
| 67 | + console.log(response.data); |
| 68 | + this.show = true; |
| 69 | + } |
| 70 | + }) |
30 | 71 | }
|
31 | 72 | }
|
32 | 73 | }
|
|
0 commit comments