fa26cc0a by renchao@pashanhoo.com

style:身份证读卡器

1 parent 4f1755d2
......@@ -2,7 +2,7 @@
/*
* @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
* @Autor: renchao
* @LastEditTime: 2023-06-13 16:28:57
* @LastEditTime: 2023-06-13 17:16:13
*/
import axios from 'axios'
import Router from '@/router'
......@@ -34,14 +34,6 @@ service.interceptors.request.use(
} else {
config.headers.delete('Authorization')
}
} else {
const token = Cookies.get('ACCESS_TOKEN')
// 添加请求头
if (token) {
config.headers['Authorization'] = 'Bearer ' + token
} else {
config.headers.delete('Authorization')
}
}
return config
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-13 15:05:35
* @LastEditTime: 2023-06-14 09:01:30
-->
<template>
<div>
......@@ -198,16 +198,20 @@
var httpurl = "http://127.0.0.1:33088/";
var url = httpurl + "function=get_idcard&readnew=0"
axios.post(url).then(res => {
if (res.data.code == 1) {
this.$message({
message: res.data.message,
type: 'warning'
})
} else {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
row.sqrmc = data.name
row.zjzl = 1
row.zjh = data.cardID
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
})
},
......