Commit b57b9c9e authored by Jennie Shi's avatar Jennie Shi

修复上传文件bug

parent 5d89a83b
Pipeline #5028 canceled with stages
...@@ -8,10 +8,10 @@ module.exports = merge(prodEnv, { ...@@ -8,10 +8,10 @@ module.exports = merge(prodEnv, {
debug: true, debug: true,
isMobilePlatform: false, isMobilePlatform: false,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ', loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_UAT&apiName="', basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"', rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_UAT&apiName=file_view&"', filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_DEV&apiName="',
ocrPath: '"http://180.104.121.66:8088/r/api"', ocrPath: '"http://180.104.121.66:8088/r/api"',
appId: '"com.xcmg.app.dev"', appId: '"com.xcmg.app.dev"',
currentVersion: '"1.9.0"', currentVersion: '"1.9.0"',
...@@ -19,5 +19,3 @@ module.exports = merge(prodEnv, { ...@@ -19,5 +19,3 @@ module.exports = merge(prodEnv, {
...@@ -11,5 +11,5 @@ module.exports = { ...@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://www.xcmgfs.com:8087/r/api"', ocrPath:'"http://www.xcmgfs.com:8087/r/api"',
fileUploadSvcPath:'"http://www.xcmgfs.com:8087/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="', fileUploadSvcPath:'"http://www.xcmgfs.com:8087/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="',
appId: '"com.xcmg.app"', appId: '"com.xcmg.app"',
currentVersion: '"0.0.8"' currentVersion: '"0.0.3"'
} }
...@@ -5,12 +5,12 @@ module.exports = { ...@@ -5,12 +5,12 @@ module.exports = {
debug: true, debug: true,
isMobilePlatform: true, isMobilePlatform: true,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ', loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_UAT&apiName="', basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_PROD&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"', rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_UAT&apiName=file_view&"', filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_PROD&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="',
appId: '"com.xcmg.app"', appId: '"com.xcmg.app.dev"',
currentVersion: '"1.7.9"' currentVersion: '"1.8.3"'
} }
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
file: '', file: '',
sessionId: '', sessionId: '',
codeList: [], codeList: [],
videoListUpload: [],
showFlag: false, showFlag: false,
} }
}, },
......
...@@ -189,6 +189,7 @@ export default { ...@@ -189,6 +189,7 @@ export default {
num: null, num: null,
downNum: false, downNum: false,
attachArray: [], attachArray: [],
faceListUpload: [],
show: false, show: false,
flag: false, // 判断是否为已确认 flag: false, // 判断是否为已确认
vehicleImg: '', // 查询到的合格证 vehicleImg: '', // 查询到的合格证
...@@ -444,18 +445,18 @@ export default { ...@@ -444,18 +445,18 @@ export default {
if (res.success && res.result.result.score) { if (res.success && res.result.result.score) {
vm.save_picture(vm.faceListUpload) vm.save_picture(vm.faceListUpload)
let identifyScore = res.result.result.score.toFixed(0) let identifyScore = res.result.result.score.toFixed(0)
// if (identifyScore >= 50) { if (identifyScore >= 50) {
hlsPopup.showPopup({ hlsPopup.showPopup({
title: '提示', title: '提示',
content: `识别分数为${identifyScore},请进行活体检测`, content: `识别分数为${identifyScore},请进行活体检测`,
onConfirm: () => { onConfirm: () => {
// 进入活体检测页面 // 进入活体检测页面
vm.goBodyCheck(vm.confirm_id) vm.goBodyCheck(vm.confirm_id)
}, },
}) })
// } else { } else {
// hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
// } }
} else { } else {
hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
} }
...@@ -505,6 +506,7 @@ export default { ...@@ -505,6 +506,7 @@ export default {
} }
if (!list[i].attachment_id) { if (!list[i].attachment_id) {
attLength++ attLength++
// alert('list[i] = ' + list[i])
hlsUtil.fileUploadSvc(list[i], uploadSuccess) hlsUtil.fileUploadSvc(list[i], uploadSuccess)
} }
} }
......
...@@ -140,6 +140,7 @@ export default { ...@@ -140,6 +140,7 @@ export default {
this.$refs.scroll.scrollToTop() this.$refs.scroll.scrollToTop()
}, },
changePage (e) { changePage (e) {
debugger
this.$router.push({ this.$router.push({
name: 'ConfirmDetail', name: 'ConfirmDetail',
params: { params: {
......
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
file: '', file: '',
sessionId: '', sessionId: '',
codeList: [], codeList: [],
videoListUpload: [],
showFlag: false, showFlag: false,
} }
}, },
......
...@@ -702,18 +702,18 @@ export default { ...@@ -702,18 +702,18 @@ export default {
if (res.success && res.result.result.score) { if (res.success && res.result.result.score) {
vm.save_picture(vm.faceListUpload) vm.save_picture(vm.faceListUpload)
let identifyScore = res.result.result.score.toFixed(0) let identifyScore = res.result.result.score.toFixed(0)
// if (identifyScore > 50) { if (identifyScore > 50) {
hlsPopup.showPopup({ hlsPopup.showPopup({
title: '提示', title: '提示',
content: `识别分数为${identifyScore},请进行活体检测`, content: `识别分数为${identifyScore},请进行活体检测`,
onConfirm: () => { onConfirm: () => {
// 进入活体检测页面 // 进入活体检测页面
vm.goBodyCheck(vm.confirm_id) vm.goBodyCheck(vm.confirm_id)
}, },
}) })
// } else { } else {
// hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
// } }
} else { } else {
hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
} }
......
...@@ -335,6 +335,7 @@ export default { ...@@ -335,6 +335,7 @@ export default {
}, },
goDetails (item) { goDetails (item) {
debugger
this.$router.push({ this.$router.push({
name: 'ContractDetail', name: 'ContractDetail',
params: { params: {
......
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
file: '', file: '',
sessionId: '', sessionId: '',
codeList: [], codeList: [],
videoListUpload: [],
showFlag: false, showFlag: false,
} }
}, },
......
...@@ -521,18 +521,18 @@ export default { ...@@ -521,18 +521,18 @@ export default {
if (res.success && res.result.result.score) { if (res.success && res.result.result.score) {
vm.save_picture(vm.faceListUpload) vm.save_picture(vm.faceListUpload)
let identifyScore = res.result.result.score.toFixed(0) let identifyScore = res.result.result.score.toFixed(0)
// if (identifyScore >= 50) { if (identifyScore >= 50) {
vm.hlsPopup.showPopup({ vm.hlsPopup.showPopup({
title: '提示', title: '提示',
content: `识别分数为${identifyScore},请进行活体检测`, content: `识别分数为${identifyScore},请进行活体检测`,
onConfirm: () => { onConfirm: () => {
// 进入活体检测页面 // 进入活体检测页面
vm.goBodyCheck() vm.goBodyCheck()
}, },
}) })
// } else { } else {
// vm.hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') vm.hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
// } }
} else { } else {
vm.hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人') vm.hlsPopup.showLongCenter('比对失败,请保证和绑定时是同一个人')
} }
......
...@@ -971,7 +971,7 @@ export default { ...@@ -971,7 +971,7 @@ export default {
let vm = this let vm = this
if (vm.bp_id) { if (vm.bp_id) {
if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO') { if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO') {
let authUrl = await vm.getNpCertificationUrl() let authUrl = hlsUtil.convertImageUrl(await vm.getNpCertificationUrl())
if (authUrl) { if (authUrl) {
const u = navigator.userAgent const u = navigator.userAgent
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
......
...@@ -398,41 +398,46 @@ export default { ...@@ -398,41 +398,46 @@ export default {
* @param success * @param success
*/ */
fileUploadSvc: function (file, success) { fileUploadSvc: function (file, success) {
let path = file.filePath if(file.pkvalue && file.source_type){
var name = path.substr(path.lastIndexOf('/') + 1) let path = file.filePath
let url = encodeURI(process.env.fileUploadSvcPath + 'attachment_upload') var name = path.substr(path.lastIndexOf('/') + 1)
let options = new FileUploadOptions() // eslint-disable-line let url = encodeURI(process.env.fileUploadSvcPath + 'attachment_upload')
options.fileKey = 'file' let options = new FileUploadOptions() // eslint-disable-line
options.headers = { options.fileKey = 'file'
'Authorization': 'Bearer ' + window.localStorage.access_token, options.headers = {
} 'Authorization': 'Bearer ' + window.localStorage.access_token,
options.params = { }
'source_type': file.source_type, options.params = {
'pkvalue': file.pkvalue, 'source_type': file.source_type,
'user_id': file.user_id, 'pkvalue': file.pkvalue,
'check_id': file.check_id, 'user_id': file.user_id,
'access_token': window.localStorage.access_token, 'check_id': file.check_id,
'filePath': path, 'access_token': window.localStorage.access_token,
} 'filePath': path,
if(file.fileName){ }
options.fileName = encodeURI(file.fileName) + name.substr(name.lastIndexOf('.')) if(file.fileName){
options.fileName = encodeURI(file.fileName) + name.substr(name.lastIndexOf('.'))
}
else{
options.fileName = name
}
options.mimeType = 'multipart/form-date'
let ft = new FileTransfer() // eslint-disable-line
function uploadSuccess (result) {
success(JSON.parse(result.response))
}
function fileError () {
window.hlsPopup.hideLoading()
console.log('upload error source ' + error.source)
console.log('upload error target ' + error.target)
}
ft.upload(path, url, uploadSuccess, fileError, options)
} }
else{ else{
options.fileName = name hlsPopup.showLongCenter('上传失败!')
}
options.mimeType = 'multipart/form-date'
let ft = new FileTransfer() // eslint-disable-line
function uploadSuccess (result) {
success(JSON.parse(result.response))
}
function fileError () {
window.hlsPopup.hideLoading()
console.log('upload error source ' + error.source)
console.log('upload error target ' + error.target)
} }
ft.upload(path, url, uploadSuccess, fileError, options)
}, },
/** /**
* 汉王识别 * 汉王识别
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.3e4289c3a03bc2b076ec4d914dfb4bba.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.6a178e8d77c32e3c385d.js></script><script type=text/javascript src=./static/js/vendor.d56dec0015f4cf7e8b3b.js></script><script type=text/javascript src=./static/js/app.da2cdd7ca6ffd4a9106e.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.4df5bfd4df456db4bc580b0772f120e7.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.6a178e8d77c32e3c385d.js></script><script type=text/javascript src=./static/js/vendor.adf9b230a1046c0fc990.js></script><script type=text/javascript src=./static/js/app.b1b90efe22b1d77d9c11.js></script></body></html>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment