【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 -3
View File
@@ -146,7 +146,7 @@
<script>
import DepartModal from './modules/DepartModal'
import { queryDepartTreeList, searchByKeywords, deleteByDepartId } from '@/api/api'
import { httpAction, deleteAction } from '@/api/manage'
import { httpAction, getAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import DepartAuthModal from './modules/DepartAuthModal'
// 表头
@@ -331,7 +331,7 @@ export default {
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据,以及子节点数据吗?',
onOk: function () {
deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
getAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadTree()
@@ -425,7 +425,7 @@ export default {
return
}
httpAction(this.url.edit, this.currSelected, 'put').then((res) => {
httpAction(this.url.edit, this.currSelected, 'post').then((res) => {
if (res.success) {
this.$message.success('保存成功!')
this.loadTree()
+3 -3
View File
@@ -140,7 +140,7 @@
<script>
import DepartModal from './modules/DepartModal'
import { deleteByDepartId, queryDepartTreeSync, searchByKeywords } from '@/api/api'
import { deleteAction, httpAction } from '@/api/manage'
import { getAction, httpAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import DepartAuthModal from './modules/DepartAuthModal'
import { cloneObject } from '@/utils/util'
@@ -367,7 +367,7 @@ export default {
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据,以及子节点数据吗?',
onOk: function () {
deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
getAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadTree()
@@ -467,7 +467,7 @@ export default {
const formData = Object.assign(this.currSelected, this.model)
console.log('Received values of form: ', formData)
httpAction(this.url.edit, formData, 'put').then((res) => {
httpAction(this.url.edit, formData, 'post').then((res) => {
if (res.success) {
this.$message.success('保存成功!')
this.loadTree()
+3 -3
View File
@@ -28,7 +28,7 @@
</template>
<script>
import { getAction, deleteAction, putAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
export default {
name: 'DictDeleteList',
data () {
@@ -97,7 +97,7 @@ export default {
})
},
handleBack (id) {
putAction('/sys/dict/back/' + id).then(res => {
postAction('/sys/dict/back/' + id).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
@@ -116,7 +116,7 @@ export default {
centered: false,
onOk: () => {
const that = this
deleteAction('/sys/dict/deletePhysic/' + id).then((res) => {
getAction('/sys/dict/deletePhysic/' + id).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
+3 -3
View File
@@ -179,7 +179,7 @@
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import { postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
@@ -423,7 +423,7 @@ export default {
return
}
const that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
getAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
@@ -450,7 +450,7 @@ export default {
title: '确认删除',
content: '是否删除选中数据?',
onOk: function () {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
getAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
@@ -55,7 +55,7 @@
<script>
import { getAction, deleteAction } from '@/api/manage'
import { getAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import SysCategoryModal from './modules/SysCategoryModal'
@@ -267,7 +267,7 @@ export default {
},
handleDelete: function (record) {
const that = this
deleteAction(that.url.delete, { id: record.id }).then((res) => {
getAction(that.url.delete, { id: record.id }).then((res) => {
if (res.success) {
// update--begin--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
that.loadData()
@@ -52,7 +52,7 @@
<script>
// import { filterObj } from '@/utils/util'
import { getAction, putAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import DynamicNotice from '../../components/tools/DynamicNotice'
@@ -143,7 +143,7 @@ export default {
this.$refs.sysAnnouncementModal.title = '查看'
},
showAnnouncement (record) {
putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
postAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
@@ -166,7 +166,7 @@ export default {
title: '确认操作',
content: '是否全部标注已读?',
onOk: function () {
putAction(that.url.readAllMsg).then((res) => {
postAction(that.url.readAllMsg).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData()
@@ -94,7 +94,7 @@
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { getAction, postAction, deleteAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
import SelectUserModal from './SelectUserModal'
import UserModal from './UserModal'
@@ -201,7 +201,7 @@ export default {
title: '确认取消',
content: '是否取消用户与选中部门的关联?',
onOk: function () {
deleteAction(that.url.deleteBatch, { depId: that.currentDeptId, userIds: ids }).then((res) => {
getAction(that.url.deleteBatch, { depId: that.currentDeptId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success('删除用户与选中部门关系成功!')
that.loadData()
@@ -225,7 +225,7 @@ export default {
}
const that = this
deleteAction(that.url.delete, { depId: this.currentDeptId, userId: id }).then((res) => {
getAction(that.url.delete, { depId: this.currentDeptId, userId: id }).then((res) => {
if (res.success) {
that.$message.success('删除用户与选中部门关系成功!')
if (this.selectedRowKeys.length > 0) {
@@ -122,13 +122,13 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
httpAction(httpurl, this.model, method).then((res) => {
@@ -103,13 +103,13 @@ export default {
if (ok) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
console.log('提交参数', this.model)
@@ -249,13 +249,13 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
if (this.userType) {
this.model.userIds = this.userIds
@@ -100,13 +100,13 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
@@ -328,9 +328,10 @@ export default {
const formData = Object.assign(this.model, mainValues, { ruleJson })
// 判断请求方式和请求地址,并发送请求
let method = 'post'; let httpUrl = this.url.add
const method = 'post'
let httpUrl = this.url.add
if (this.model.id) {
method = 'put'
// method = 'put'
httpUrl = this.url.edit
}
this.confirmLoading = true
@@ -214,10 +214,11 @@ export default {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
let httpUrl = this.url.add; let method = 'post'
let httpUrl = this.url.add
const method = 'post'
if (this.model.id) {
httpUrl = this.url.edit
method = 'put'
// method = 'put'
// 由于编码的特殊性,所以不能更改
formData.code = undefined
}
@@ -108,10 +108,11 @@ export default {
this.$refs.form.validate((ok) => {
if (ok) {
that.confirmLoading = true
let httpUrl = this.url.add; let method = 'post'
let httpUrl = this.url.add
const method = 'post'
if (this.model.id) {
httpUrl = this.url.edit
method = 'put'
// method = 'put'
}
httpAction(httpUrl, this.model, method).then((res) => {
@@ -131,13 +131,13 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
httpAction(httpurl, this.model, method).then((res) => {
@@ -142,13 +142,13 @@ export default {
if (!err) {
that.confirmLoading = true
let httpurl = ''
let method
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)
httpAction(httpurl, formData, method).then((res) => {
@@ -138,13 +138,13 @@ export default {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method
const method = 'post'
if (!this.id) {
httpurl += this.url.add
method = 'post'
// method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
// method = 'put'
}
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
@@ -53,7 +53,7 @@
</template>
<script>
import { putAction, deleteAction, getFileAccessHttpUrl } from '@/api/manage'
import { getFileAccessHttpUrl, getAction, postAction } from '@/api/manage'
// 高度封装的请求,请务必使用 superRequest.call(this,{}) 的方式调用
function superRequest (options) {
@@ -140,7 +140,7 @@ export default {
content: `您确定要恢复这 ${userIds.length} 个用户吗?`,
centered: true,
onOk: () => {
putAction(this.url.putRecycleBin, { userIds: userIds.join(',') }).then((res) => {
postAction(this.url.putRecycleBin, { userIds: userIds.join(',') }).then((res) => {
if (res.success) {
this.handleOk()
this.handleClearSelection()
@@ -161,7 +161,7 @@ export default {
centered: true,
onOk: () => {
const that = this
deleteAction(that.url.deleteRecycleBin, { userIds: userIds.join(',') }).then((res) => {
getAction(that.url.deleteRecycleBin, { userIds: userIds.join(',') }).then((res) => {
if (res.success) {
this.loadData()
this.handleClearSelection()