人员管理(劳务人员):新增上传身份证头像压缩逻辑

This commit is contained in:
Jack 2022-07-28 17:57:29 +08:00
parent e8fa8824ab
commit 9bc6007ba1
2 changed files with 17 additions and 13 deletions

View File

@ -56,7 +56,7 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://117.156.17.59:9090/'; //
// axios.defaults.baseURL = 'http://120.236.247.200:9000/'; //横琴线上
// axios.defaults.baseURL = 'http://223.82.100.80:9000/'; //南昌地铁
axios.defaults.baseURL = 'http://139.9.66.234:40001/'; //南昌地铁二期
// axios.defaults.baseURL = 'http://139.9.66.234:40001/'; //南昌地铁二期
// axios.defaults.baseURL = 'http://124.71.178.44:30/';
// axios.defaults.baseURL = 'http://192.168.34.125:9090/';
// axios.defaults.baseURL = 'http://192.168.88.220:6023/';

View File

@ -1997,7 +1997,6 @@ import {
updateByIdWorkerInfo,
sendBatchWokerApi
} from '@/assets/js/api/laborPerson'
import axios from 'axios'
import {
selectUserDevAuthorityByUserIdApi,
exporExcelWorkerTemplateApi
@ -2011,6 +2010,7 @@ import { getProjectConfigListApi } from '@/assets/js/api/project.js'
import { VueCropper } from 'vue-cropper'
import { apiUploadImage } from '@/assets/js/api/common'
import lrz from 'lrz'
export default {
components: {
VueCropper
@ -2249,8 +2249,11 @@ export default {
this.$message.error(this.$t('message.companyDiagram.uploadMsg')) //
return false
}
//
lrz(file, { quality: 1 }).then((result) => {
const formData = new FormData()
formData.append('files', file)
formData.append('files', result.file)
apiUploadImage(formData).then((res) => {
if (res.code == 200 || res.status == 'SUCCESS') {
const data = res.data
@ -2262,6 +2265,7 @@ export default {
this.idCardUpPhotoFile = [obj]
}
})
})
},
checkImg() {
console.log(this.radio)