Skip to content

Commit 87af35d

Browse files
committed
info
1 parent c300ca1 commit 87af35d

File tree

1 file changed

+56
-15
lines changed

1 file changed

+56
-15
lines changed

src/components/info.vue

+56-15
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,73 @@
11
<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>
214
<el-descriptions
315
direction="vertical"
416
border
517
: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>
1626
</el-descriptions>
27+
</div>
1728
</template>
1829

1930
<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";
2035
export default {
2136
name: 'info',
2237
data() {
2338
return {
2439
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+
})
3071
}
3172
}
3273
}

0 commit comments

Comments
 (0)