2b4148cb4e58f64d0707fb463bcecfL198">198
let sendData = this.editor.get()
let arr = Object.keys(sendData)
console.log(sendData, typeof(sendData))
let qsStr = Qs.stringify(sendData)
console.log('qsStr', qsStr)
if (arr.length !== 0) {
console.log(1 + 'post')
console.log(1 + 'post' + 'application/x-www-from-urlencoded')
this.NProgress.start()
this.axios.post(this.requestPath + this.path, sendData, {headers: {'content-type': 'application/x-www-form-urlencoded'}}).then((res) => {
this.axios.post(this.requestPath, qsStr, {headers: {'content-type': 'application/x-www-form-urlencoded'}}).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
@ -216,9 +214,9 @@ export default {
this.$message.error('服务请求报错!')
})
} else {
console.log(2 + 'post')
console.log(2 + 'post' + 'application/x-www-from-urlencoded')
this.NProgress.start()
this.axios.post(this.requestPath + this.path, {headers: {'content-type': 'application/x-www-form-urlencoded'}}).then((res) => {
this.axios.post(this.requestPath, {headers: {'content-type': 'application/x-www-form-urlencoded'}}).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
@ -238,9 +236,9 @@ export default {
let arr = Object.keys(sendData)
console.log(sendData, typeof(sendData))
if (arr.length !== 0) {
console.log(1 + 'post')
console.log(1 + 'post' + 'multipart/form-data')
this.NProgress.start()
this.axios.post(this.requestPath + this.path, sendData, {headers: {'content-type': 'multipart/form-data'}}).then((res) => {
this.axios.post(this.requestPath, sendData, {headers: {'content-type': 'multipart/form-data'}}).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
@ -255,9 +253,9 @@ export default {
this.$message.error('服务请求报错!')
})
} else {
console.log(2 + 'post')
console.log(2 + 'post' + 'multipart/form-data')
this.NProgress.start()
this.axios.post(this.requestPath + this.path, {headers: {'content-type': 'multipart/form-data'}}).then((res) => {
this.axios.post(this.requestPath, {headers: {'content-type': 'multipart/form-data'}}).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
@ -280,7 +278,7 @@ export default {
if (arr.length !== 0) {
console.log(1 + 'get')
this.NProgress.start()
this.axios.get(this.requestPath + this.path, {params: getData}).then((res) => {
this.axios.get(this.requestPath, {params: getData}).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
@ -297,7 +295,7 @@ export default {
} else {
console.log(2 + 'get')
this.NProgress.start()
this.axios.get(this.requestPath + this.path).then((res) => {
this.axios.get(this.requestPath).then((res) => {
console.log('ok')
this.responser.set(res)
this.NProgress.done()
|
||
1 | 1 |
|
2 | 2 |
|
3 |
|
|
3 |
|
|
4 | 4 |
|