Commit a2afcd08 authored by 潘永坪's avatar 潘永坪

图片上传优化

parent be856d06
...@@ -134,7 +134,7 @@ export default{ ...@@ -134,7 +134,7 @@ export default{
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
message: '', message: '',
url: result url:'http://picture.pangdly.com/'+result
})) }))
fileListLen++ fileListLen++
} }
...@@ -163,14 +163,8 @@ export default{ ...@@ -163,14 +163,8 @@ export default{
//---提交 //---提交
commit(){ commit(){
this.imgList=this.fileList1.map(item=>{ this.imgList=this.fileList1.map(item=>{
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://picture.tuyoyoo.com/'
}else{
baseUrl= 'http://picture.pangdly.com/'
}
return { return {
imgUrl:baseUrl+item.url, imgUrl:item.url,
imgCommentType:0//0游客发起图片 1客服回复图片 imgCommentType:0//0游客发起图片 1客服回复图片
} }
}) })
......
...@@ -193,7 +193,7 @@ export default{ ...@@ -193,7 +193,7 @@ export default{
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
message: '', message: '',
url: result url:'http://picture.pangdly.com/'+result
})) }))
fileListLen++ fileListLen++
} }
...@@ -222,14 +222,8 @@ export default{ ...@@ -222,14 +222,8 @@ export default{
//---提交 //---提交
commit(){ commit(){
this.imgList=this.fileList1.map(item=>{ this.imgList=this.fileList1.map(item=>{
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://picture.tuyoyoo.com/'
}else{
baseUrl= 'http://picture.pangdly.com/'
}
return { return {
imgUrl:baseUrl+item.url, imgUrl:item.url,
imgCommentType:0//0游客发起图片 1客服回复图片 imgCommentType:0//0游客发起图片 1客服回复图片
} }
}) })
......
...@@ -93,10 +93,11 @@ export default{ ...@@ -93,10 +93,11 @@ export default{
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
message: '', message: '',
url: result url:'http://picture.pangdly.com/'+result
})) }))
fileListLen++ fileListLen++
} }
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -122,14 +123,8 @@ export default{ ...@@ -122,14 +123,8 @@ export default{
//---提交 //---提交
commit(){ commit(){
this.imgList=this.fileList1.map(item=>{ this.imgList=this.fileList1.map(item=>{
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://picture.tuyoyoo.com/'
}else{
baseUrl= 'http://picture.pangdly.com/'
}
return { return {
imgUrl:baseUrl+item.url, imgUrl:item.url,
imgCommentType:0//0游客发起图片 1客服回复图片 imgCommentType:0//0游客发起图片 1客服回复图片
} }
}) })
......
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