Commit 90f19a5f by cwq0219

修改

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