Commit 90f19a5f by cwq0219

修改

1 parent 41e1d80e
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
alt="" alt=""
@click="handleImg()" @click="handleImg()"
> >
<gl-upload <!-- <gl-upload
id="upload" id="upload"
v-if="isEdit" v-if="isEdit"
class="upload-demo" class="upload-demo"
...@@ -74,13 +74,18 @@ ...@@ -74,13 +74,18 @@
<gl-button <gl-button
size="small" size="small"
>上传图片</gl-button> >上传图片</gl-button>
</gl-upload> </gl-upload> -->
<!-- <input v-if="isEdit" type="file" id="id" name="image" class="getImgUrl_file" @change="shangc($event)" accept="image/jpg,image/jpeg,image/png"> -->
<!-- <form id="uploadForm" enctype="application/x-www-form-urlencoded">
<input type="file" id="id" name="image" class="getImgUrl_file" accept="image/jpg,image/jpeg,image/png">
<button id="upload" type="button" @click="aa($event)">upload</button>
</form> -->
<!-- <form v-if="isEdit" method="post" action="http://gfs.test.glsx.com.cn/file/upstring" >
<input type="file" id="id" name="image" class="getImgUrl_file" @change="shangc($event)" accept="image/jpg,image/jpeg,image/png"> <input type="file" id="id" name="image" class="getImgUrl_file" @change="shangc($event)" accept="image/jpg,image/jpeg,image/png">
<form method="post" action="http://gfs.test.glsx.com.cn/file/upstring"> <input name="systemSign" value="mechantData"><br>
<input type="systemSign" name="" /> <input name="files" v-model="fileImg"><br>
<br/><br/> <input type="submit" value="登录">
<input type="files" name="" /> </form> -->
</form>
</span> </span>
<gl-select <gl-select
v-else-if="i.name == 'merchantChannelName' && isEdit" v-else-if="i.name == 'merchantChannelName' && isEdit"
...@@ -216,6 +221,7 @@ export default { ...@@ -216,6 +221,7 @@ export default {
editOptions: ['address', 'contactor', 'contactPhone', 'phone', 'email'], editOptions: ['address', 'contactor', 'contactPhone', 'phone', 'email'],
channelList: [], channelList: [],
fileInfo: { fileType: '', fileBase: '' }, fileInfo: { fileType: '', fileBase: '' },
fileImg: '',
List: [ List: [
{ {
name: 'merchantName', name: 'merchantName',
...@@ -674,33 +680,37 @@ export default { ...@@ -674,33 +680,37 @@ export default {
// console.log(this.fileInfo.fileType) // console.log(this.fileInfo.fileType)
// console.log(this.fileInfo.fileBase) // console.log(this.fileInfo.fileBase)
const fileParams = this.fileInfo.fileType + '@' + this.fileInfo.fileBase const fileParams = this.fileInfo.fileType + '@' + this.fileInfo.fileBase
this.fileImg = this.fileInfo.fileType + '@' + this.fileInfo.fileBase
const aa = { const aa = {
systemSign: 'mechantData', systemSign: 'mechantData',
files: fileParams files: fileParams
} }
const fileTemp = JSON.stringify(aa) console.log(aa)
console.log(fileTemp) // const fileTemp = JSON.stringify(aa)
// console.log(fileTemp)
// var formData = new FormData()
// formData.append('systemSign', 'mechantData')
// formData.append('files', fileParams)
// axios({ // axios({
// method: 'post', // method: 'post',
// headers: { // headers: {
// 'Content-Type': 'application/json' // 'Content-Type': 'application/x-www-form-urlencoded'
// }, // },
// transformRequest: [function(data) { // // transformRequest: [function(data) {
// console.log('---------') // // console.log('---------')
// data = JSON.stringify(data) // // data = JSON.stringify(data)
// return data // // return data
// }], // // }],
// url: 'http://gfs.test.glsx.com.cn/file/upstring', // url: 'http://gfs.test.glsx.com.cn/file/upstring',
// params: {}, // data: aa,
// data: { // // dataType: 'json', // jsonp会把请求类型强制转换为get请求
// 'systemSign': 'mechantData', // // contentType: false,
// 'files': fileParams // processData: false
// }
// }) // })
// axios.post('http://gfs.test.glsx.com.cn/file/upstring', { fileTemp }, // axios.post('http://gfs.test.glsx.com.cn/file/upstring', formData,
// { // {
// headers: { // headers: {
// 'content-type': 'application/x-www-form-urlencoded' // 'Content-Type': 'application/x-www-form-urlencoded'
// } // }
// // requestType: 'jsonString' // // requestType: 'jsonString'
// }).then(res => { // }).then(res => {
...@@ -708,25 +718,25 @@ export default { ...@@ -708,25 +718,25 @@ export default {
// }).catch(err => { // }).catch(err => {
// console.log(err) // console.log(err)
// }) // })
axios({ // axios({
method: 'post', // method: 'post',
url: 'http://gfs.test.glsx.com.cn/file/upstring', // url: 'http://gfs.test.glsx.com.cn/file/upstring',
data: aa, // data: aa,
// headers: { // // headers: {
// 'content-type': 'application/x-www-form-urlencoded' // // 'content-type': 'application/x-www-form-urlencoded'
// }, // // },
transformRequest: [function(data) { // transformRequest: [function(data) {
console.log(data) // console.log(data)
data = JSON.stringify(data) // data = JSON.stringify(data)
console.log(data) // console.log(data)
return data // return data
}] // }]
// requestType: 'jsonString' // // requestType: 'jsonString'
}).then(res => { // }).then(res => {
console.log(res) // console.log(res)
}).catch(err => { // }).catch(err => {
console.log(err) // console.log(err)
}) // })
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!