【fix bug】axios请求,put改为post,delete改为get
This commit is contained in:
@@ -279,10 +279,10 @@ export default {
|
||||
},
|
||||
/** 发起新增或修改的请求 */
|
||||
requestAddOrEdit (formData) {
|
||||
let url = this.url.add; let method = 'post'
|
||||
let url = this.url.add; const method = 'post'
|
||||
if (this.model.id) {
|
||||
url = this.url.edit
|
||||
method = 'put'
|
||||
// method = 'put'
|
||||
}
|
||||
this.confirmLoading = true
|
||||
httpAction(url, formData, method).then((res) => {
|
||||
|
||||
@@ -108,13 +108,12 @@ export default {
|
||||
if (valid) {
|
||||
that.confirmLoading = true
|
||||
let httpUrl
|
||||
let method
|
||||
const method = 'post'
|
||||
if (!this.model.id) {
|
||||
httpUrl = this.url.add
|
||||
method = 'post'
|
||||
} else {
|
||||
httpUrl = this.url.edit
|
||||
method = 'put'
|
||||
// method = 'put'
|
||||
}
|
||||
|
||||
httpAction(httpUrl, this.model, method).then((res) => {
|
||||
|
||||
@@ -203,13 +203,14 @@ export default {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let httpurl, method
|
||||
let httpurl
|
||||
const method = 'post'
|
||||
if (!this.model.id) {
|
||||
httpurl = this.url.add
|
||||
method = 'post'
|
||||
// method = 'post'
|
||||
} else {
|
||||
httpurl = this.url.edit
|
||||
method = 'put'
|
||||
// method = 'put'
|
||||
}
|
||||
const formData = Object.assign(this.model, values)
|
||||
// 时间格式化
|
||||
|
||||
@@ -222,13 +222,14 @@ export default {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
that.confirmLoading = true
|
||||
let httpurl, method
|
||||
let httpurl
|
||||
const method = 'post'
|
||||
if (!this.orderMainModel.id) {
|
||||
httpurl = this.url.add
|
||||
method = 'post'
|
||||
// method = 'post'
|
||||
} else {
|
||||
httpurl = this.url.edit
|
||||
method = 'put'
|
||||
// method = 'put'
|
||||
}
|
||||
|
||||
httpAction(httpurl, this.orderMainModel, method).then((res) => {
|
||||
|
||||
@@ -283,10 +283,11 @@ export default {
|
||||
},
|
||||
/** 发起新增或修改的请求 */
|
||||
requestAddOrEdit (formData) {
|
||||
let url = this.url.add; let method = 'post'
|
||||
let url = this.url.add
|
||||
const method = 'post'
|
||||
if (this.model.id) {
|
||||
url = this.url.edit
|
||||
method = 'put'
|
||||
// method = 'put'
|
||||
}
|
||||
this.confirmLoading = true
|
||||
httpAction(url, formData, method).then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user