hint DELETE接口需要加上application/json头

This commit is contained in:
g7hoo 2022-08-10 14:12:23 +08:00
parent 9653474e2f
commit 90e34584ec

View File

@ -54,7 +54,7 @@
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs"></base-dialog> <base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList"></base-dialog>
</div> </div>
</template> </template>
@ -73,7 +73,7 @@ const ProductTypeDictTypeId = '1557179530308616193'
const tableConfigs = [ const tableConfigs = [
{ type: 'index', name: '序号' }, { type: 'index', name: '序号' },
{ prop: 'updateTime', name: '添加时间', filter: val => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') }, { prop: 'updateTime', name: '添加时间', filter: val => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') },
{ prop: 'name', name: '产品名称'}, { prop: 'name', name: '产品名称' },
{ prop: 'code', name: '产品编码' }, { prop: 'code', name: '产品编码' },
{ prop: 'specifications', name: '规格' }, { prop: 'specifications', name: '规格' },
{ prop: 'unitDictValue', name: '单位', filter: dictFilter(UnitDictTypeId) }, { prop: 'unitDictValue', name: '单位', filter: dictFilter(UnitDictTypeId) },
@ -264,10 +264,11 @@ export default {
}, },
// //
deleteHandle(id) { deleteHandle(id) {
console.log('id is: ', id)
var ids = id var ids = id
? [id] ? [id]
// ? [1556817256347828335] : // ? [1556817256347828335]
: this.dataListSelections.map(item => { this.dataListSelections.map(item => {
return item.id return item.id
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
@ -278,6 +279,9 @@ export default {
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/product'), url: this.$http.adornUrl('/monitoring/product'),
method: 'delete', method: 'delete',
headers: {
'Content-Type': 'application/json'
},
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {