From 83fb096f6d0bb5f4401c78e608e065ea2ab8d7ff Mon Sep 17 00:00:00 2001 From: g7hoo Date: Wed, 10 Aug 2022 14:49:17 +0800 Subject: [PATCH] =?UTF-8?q?update=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 2 +- src/views/modules/monitoring/product.vue | 34 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 7a81e32..c8256a7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -96,7 +96,7 @@ http.adornData = (data = {}, openDefaultdata = true, contentType = 'json') => { 't': new Date().getTime() } data = openDefaultdata ? merge(defaults, data) : data - return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data) + return contentType === 'raw' ? data : contentType === 'json' ? JSON.stringify(data) : qs.stringify(data) // return contentType === 'json' ? JSON.stringify(data, (_, v) => typeof v === 'bigint' ? v.toString() : v) : qs.stringify(data) } diff --git a/src/views/modules/monitoring/product.vue b/src/views/modules/monitoring/product.vue index af57a4d..a63803b 100644 --- a/src/views/modules/monitoring/product.vue +++ b/src/views/modules/monitoring/product.vue @@ -279,24 +279,24 @@ export default { this.$http({ url: this.$http.adornUrl('/monitoring/product'), method: 'delete', - headers: { - 'Content-Type': 'application/json' - }, - data: this.$http.adornData(ids, false) - }).then(({ data }) => { - if (data && data.code === 0) { - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - this.getDataList() - } - }) - } else { - this.$message.error(data.msg) - } + data: ids + // or : data: this.$http.adornData(ids, false, 'raw') }) + // or: this.$http.delete(this.$http.adornUrl('/monitoring/product'), { data: this.$http.adornData(ids, false) }) + .then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + this.getDataList() + } + }) + } else { + this.$message.error(data.msg) + } + }) }) } }