perf: 清除addendpoint时发送的无用数据

This commit is contained in:
陈劲松
2020-03-13 13:39:18 +08:00
parent 46ac7be388
commit dcf51c4793

View File

@@ -533,9 +533,15 @@
this.$refs.addEndpointForm.validate(); this.$refs.addEndpointForm.validate();
return false; return false;
} }
//对endpointList进行处理避免携带过多无用数据
let endpointList = [];
this.endpointList.forEach((item, index) => {
let endpoint = {moduleId: item.moduleId, assetId: item.assetId, port: item.port, param: item.param, path: item.path, host: item.host};
endpointList.push(endpoint);
});
this.$refs.addEndpointForm.validate((valid) => { this.$refs.addEndpointForm.validate((valid) => {
if (valid) { if (valid) {
this.$post('endpoint', this.endpointList).then(response => { this.$post('endpoint', endpointList).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
this.esc(); this.esc();