Commit b8ba49a5 by 严立

图片上传增加路径校验

parent b14fe58b
let output = {
// 测试环境
base: '/Api/', // 部署路径
// base: '/Api/', // 部署路径
// base: 'http://bid-server.meiqicloud.com/', // 开发路径
resources: 'http://bid-web.meiqicloud.com',
agentSignIn: 'http://bid-vue.meiqicloud.com/'
// resources: 'http://bid-web.meiqicloud.com',
// agentSignIn: 'http://bid-vue.meiqicloud.com/'
// 正式环境
// base: 'https://www.fjbidding.com/Api/',
// resources: 'https://www.fjbidding.com',
// agentSignIn: 'https://www.fjbidding.com/admin/'
base: 'https://www.fjbidding.com/Api/',
resources: 'https://www.fjbidding.com',
agentSignIn: 'https://www.fjbidding.com/admin/'
}
output.uploadFile = output.base + 'bid/common/webupload/upload'
......
......@@ -866,6 +866,7 @@
// 证照上传
this.$refs.formLicense.validate(funcValid => {
console.log(this.uploadOption.license)
if (funcValid) {
if (this.uploadOption.license.image.length > 0) {
for (let i = 0, len = this.uploadOption.license.image.length; i < len; i++) {
......@@ -903,6 +904,25 @@
}
}
}
// 校验图片上传后的路径是否正确
if (this.uploadOption.license.image.length > 0) {
for (let i = 0, len = this.uploadOption.license.image.length; i < len; i++) {
if (this.uploadOption.license.image[i].url.indexOf('blob:') >= 0) {
this.$message.error('图片上传失败,请删除重试。')
return
}
}
}
if (this.uploadOption.quote.image.length > 0) {
for (let i = 0, len = this.uploadOption.quote.image.length; i < len; i++) {
if (this.uploadOption.quote.image[i].url.indexOf('blob:') >= 0) {
this.$message.error('图片上传失败,请删除重试。')
return
}
}
}
this.state = 5
}
})
......
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 sign in to comment