【fix bug】axios请求,put改为post,delete改为get

This commit is contained in:
zhaoxiao
2023-03-14 10:08:24 +08:00
parent 921e9d20bd
commit 8a45c78a57
43 changed files with 127 additions and 118 deletions
+3 -2
View File
@@ -117,10 +117,11 @@ export const JEditableTableMixin = {
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request (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) => {
@@ -116,10 +116,11 @@ export const JEditableTableModelMixin = {
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request (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) => {
+2 -2
View File
@@ -106,10 +106,10 @@ export const JVxeTableMixin = {
/** 发起请求,自动判断是执行新增还是修改操作 */
request (formData) {
let url = this.url.add
let method = 'post'
const method = 'post'
if (this.model.id) {
url = this.url.edit
method = 'put'
// method = 'put'
}
this.confirmLoading = true
console.log('formData===>', formData)
+3 -2
View File
@@ -105,10 +105,11 @@ export const JVxeTableModelMixin = {
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request (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
console.log('formData===>', formData)
+3 -3
View File
@@ -4,7 +4,7 @@
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
*/
import { filterObj } from '@/utils/util'
import { deleteAction, downFile, getAction, getFileAccessHttpUrl } from '@/api/manage'
import { downFile, getAction, getFileAccessHttpUrl } from '@/api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
import store from '@/store'
@@ -174,7 +174,7 @@ export const JeroListMixin = {
content: '是否删除选中数据?',
onOk: function () {
that.loading = true
deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
getAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
// 重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
@@ -197,7 +197,7 @@ export const JeroListMixin = {
return
}
const that = this
deleteAction(that.url.delete, { id: id }).then((res) => {
getAction(that.url.delete, { id: id }).then((res) => {
if (res.success) {
// 重新计算分页问题
that.reCalculatePage(1)