fa26cc0a by renchao@pashanhoo.com

style:身份证读卡器

1 parent 4f1755d2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 /* 2 /*
3 * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 3 * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
4 * @Autor: renchao 4 * @Autor: renchao
5 * @LastEditTime: 2023-06-13 16:28:57 5 * @LastEditTime: 2023-06-13 17:16:13
6 */ 6 */
7 import axios from 'axios' 7 import axios from 'axios'
8 import Router from '@/router' 8 import Router from '@/router'
...@@ -34,14 +34,6 @@ service.interceptors.request.use( ...@@ -34,14 +34,6 @@ service.interceptors.request.use(
34 } else { 34 } else {
35 config.headers.delete('Authorization') 35 config.headers.delete('Authorization')
36 } 36 }
37 } else {
38 const token = Cookies.get('ACCESS_TOKEN')
39 // 添加请求头
40 if (token) {
41 config.headers['Authorization'] = 'Bearer ' + token
42 } else {
43 config.headers.delete('Authorization')
44 }
45 } 37 }
46 return config 38 return config
47 }, 39 },
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-06-13 15:05:35 4 * @LastEditTime: 2023-06-14 09:01:30
5 --> 5 -->
6 <template> 6 <template>
7 <div> 7 <div>
...@@ -198,16 +198,20 @@ ...@@ -198,16 +198,20 @@
198 var httpurl = "http://127.0.0.1:33088/"; 198 var httpurl = "http://127.0.0.1:33088/";
199 var url = httpurl + "function=get_idcard&readnew=0" 199 var url = httpurl + "function=get_idcard&readnew=0"
200 axios.post(url).then(res => { 200 axios.post(url).then(res => {
201 if (res.data.code == 1) { 201 if (res.data.code == 0) {
202 this.$message({
203 message: res.data.message,
204 type: 'warning'
205 })
206 } else {
207 let data = res.data.IDCardInfo 202 let data = res.data.IDCardInfo
208 row.sqrmc = data.name 203 row.sqrmc = data.name
209 row.zjzl = 1 204 row.zjzl = 1
210 row.zjh = data.cardID 205 row.zjh = data.cardID
206 this.$message({
207 message: '读取成功!',
208 type: 'success'
209 })
210 } else {
211 this.$message({
212 message: res.data.message,
213 type: 'warning'
214 })
211 } 215 }
212 }) 216 })
213 }, 217 },
......