Commit 91a221d4 authored by 刘怀志's avatar 刘怀志

将取值为null或者undefined的字段剔除不传到后台

parent 6cffda67
......@@ -47,6 +47,12 @@ service.interceptors.request.use(config => {
var resultEncryptFlag = secret.checkResultEncryptAble()
// get请求映射params参数
if (config.method === 'get' && config.params) {
// 将取值为null或者undefined的字段剔除不传到后台
for(let key in config.params) {
if (config.params[key] == undefined || config.params[key] == null){
delete config.params[key]
}
}
console.log('加密前参数get', config.params)
if (paramEncryptFlag && config.params) {
config.headers['Product'] = 'Advanced'
......@@ -89,8 +95,14 @@ service.interceptors.request.use(config => {
}
}
console.log('加密前参数post', config.data)
if (paramEncryptFlag && config.data) {
// 将取值为null或者undefined的字段剔除不传到后台
for(let key in config.params) {
if (config.params[key] == undefined || config.params[key] == null){
delete config.params[key]
}
}
console.log('加密前参数post', config.data)
config.data = secret.encrypt(config.data)
}
return config
......
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="88px">
<el-form-item label="链路带宽" prop="linkBandwidth">
<el-form-item label="链路带宽" prop="linkBandwidthParam">
<el-select
v-model="queryParams.linkBandwidth"
v-model="queryParams.linkBandwidthParam"
clearable
placeholder="请选链路带宽"
style="width: 100%"
......@@ -133,15 +133,8 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
userId: null,
deviceId: null,
deviceName: null,
leftIp: null,
rightIp: null,
linkBandwidth: null,
bandwidthUtilizationString: null,
packetLossRate: null,
linkType: null
linkBandwidthParam: '',
bandwidthUtilizationString: ''
},
// 表单参数
form: {},
......@@ -164,9 +157,11 @@ export default {
getList() {
this.loading = true
const temp = {
...this.queryParams,
maxBandwidthUtil: this.queryParams.bandwidthUtilizationString ? this.queryParams.bandwidthUtilizationString.split(',')[1] : null,
minBandwidthUtil: this.queryParams.bandwidthUtilizationString ? this.queryParams.bandwidthUtilizationString.split(',')[0] : null
...this.queryParams
}
if (this.queryParams.bandwidthUtilizationString) {
temp['maxBandwidthUtil'] = this.queryParams.bandwidthUtilizationString.split(',')[1]
temp['minBandwidthUtil'] = this.queryParams.bandwidthUtilizationString.split(',')[0]
}
listTopology(temp).then(response => {
this.topologyList = response.rows
......@@ -188,9 +183,8 @@ export default {
deviceName: null,
leftIp: null,
rightIp: null,
linkBandwidth: null,
linkBandwidthParam: null,
bandwidthUtilizationString: null,
packetLossRate: null,
linkType: null,
createBy: null,
createTime: null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment